aboutsummaryrefslogtreecommitdiff
path: root/src/layout/focus_ring.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-01-04 10:14:51 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-01-04 11:22:56 +0300
commita2f9d132a088e399fb1f292d84d3d3862127f02e (patch)
tree0e04941d8ae35be9362c53f8d41177cc71e24214 /src/layout/focus_ring.rs
parent1973b97cc2a51d697add3d9ad7210a4e6eba9183 (diff)
downloadniri-a2f9d132a088e399fb1f292d84d3d3862127f02e.tar.gz
niri-a2f9d132a088e399fb1f292d84d3d3862127f02e.tar.bz2
niri-a2f9d132a088e399fb1f292d84d3d3862127f02e.zip
Migrate to new Rectangle functions
Diffstat (limited to 'src/layout/focus_ring.rs')
-rw-r--r--src/layout/focus_ring.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/layout/focus_ring.rs b/src/layout/focus_ring.rs
index 7cd73760..b6c65b3f 100644
--- a/src/layout/focus_ring.rs
+++ b/src/layout/focus_ring.rs
@@ -94,7 +94,7 @@ impl FocusRing {
in_: GradientInterpolation::default(),
});
- let full_rect = Rectangle::from_loc_and_size((-width, -width), self.full_size);
+ let full_rect = Rectangle::new(Point::from((-width, -width)), self.full_size);
let gradient_area = match gradient.relative_to {
GradientRelativeTo::Window => full_rect,
GradientRelativeTo::WorkspaceView => view_rect,
@@ -178,12 +178,12 @@ impl FocusRing {
for (border, (loc, size)) in zip(&mut self.borders, zip(self.locations, self.sizes)) {
border.update(
size,
- Rectangle::from_loc_and_size(gradient_area.loc - loc, gradient_area.size),
+ Rectangle::new(gradient_area.loc - loc, gradient_area.size),
gradient.in_,
gradient.from,
gradient.to,
((gradient.angle as f32) - 90.).to_radians(),
- Rectangle::from_loc_and_size(full_rect.loc - loc, full_rect.size),
+ Rectangle::new(full_rect.loc - loc, full_rect.size),
rounded_corner_border_width,
radius,
scale as f32,
@@ -196,15 +196,12 @@ impl FocusRing {
self.borders[0].update(
self.sizes[0],
- Rectangle::from_loc_and_size(
- gradient_area.loc - self.locations[0],
- gradient_area.size,
- ),
+ Rectangle::new(gradient_area.loc - self.locations[0], gradient_area.size),
gradient.in_,
gradient.from,
gradient.to,
((gradient.angle as f32) - 90.).to_radians(),
- Rectangle::from_loc_and_size(full_rect.loc - self.locations[0], full_rect.size),
+ Rectangle::new(full_rect.loc - self.locations[0], full_rect.size),
rounded_corner_border_width,
radius,
scale as f32,