Skip to content

Commit 7f4135f

Browse files
committed
docs(desktop): document snapshot animation geometry
1 parent b81ed35 commit 7f4135f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎native/hyprland-snap-shot/src/feedback.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ fn clip(rect: Rect, output: Rect, image: (u32, u32)) -> Option<(Rect, Rect)> {
142142
},
143143
))
144144
}
145+
/// Interpolates the flight rectangle with cubic ease-out, clamping progress to [0, 1].
145146
fn interpolate(from: Rect, to: Rect, progress: f64) -> Rect {
146147
let t = 1.0 - (1.0 - progress.clamp(0., 1.)).powi(3);
147148
Rect {
@@ -151,6 +152,7 @@ fn interpolate(from: Rect, to: Rect, progress: f64) -> Rect {
151152
height: from.height + (to.height - from.height) * t,
152153
}
153154
}
155+
/// Validates a normalized destination frame and maps it into logical window bounds.
154156
fn target(bounds: Rect, frame: Rect) -> Result<Rect> {
155157
if !bounds.valid()
156158
|| !frame.valid()

0 commit comments

Comments
 (0)