MSAA + outlines are now inset

Inset outlines may not be the right approach, but it simplifies
potential alignment issues caused by insetting all filled background
drawing by half the width of the focus ring.
This commit is contained in:
Jonathan Johnson 2023-11-19 14:29:21 -08:00
parent d5bde44e27
commit 9403e85901
No known key found for this signature in database
GPG key ID: A66D6A34D6620579
3 changed files with 4 additions and 4 deletions

2
Cargo.lock generated
View file

@ -1089,7 +1089,7 @@ checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
[[package]]
name = "kludgine"
version = "0.1.0"
source = "git+https://github.com/khonsulabs/kludgine#0530299bbe79431b5fa398182991c63e06d94b90"
source = "git+https://github.com/khonsulabs/kludgine#f286d7de3f37ec7430890f6eeeb5d98a1ff0314e"
dependencies = [
"ahash",
"alot",

View file

@ -546,10 +546,10 @@ impl<'context, 'window, 'clip, 'gfx, 'pass> GraphicsContext<'context, 'window, '
{
if color.alpha() > 0 {
let options = options.colored(color).into_px(self.gfx.scale());
let inset = options.line_width;
let inset = options.line_width / 2;
let visible_rect = Rect::new(
Point::squared(inset),
self.gfx.region().size - Point::new(inset * 2, inset * 2),
self.gfx.region().size - Point::squared(inset),
);
let radii = self.get(&CornerRadius);

View file

@ -136,6 +136,6 @@ define_components! {
OpaqueWidgetColor(Color, "opaque_color", .surface.opaque_widget)
/// A set of radius descriptions for how much roundness to apply to the
/// shapes of widgets.
CornerRadius(CornerRadii<Dimension>, "corner_radius", CornerRadii::from(Dimension::Lp(Lp::points(100))))
CornerRadius(CornerRadii<Dimension>, "corner_radius", CornerRadii::from(Dimension::Lp(Lp::points(7))))
}
}