Skip to content

Commit 1931cd3

Browse files
author
Jay
committed
Add limit_scroll doc and assert
1 parent 1d4ea4d commit 1931cd3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/engine.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4164,7 +4164,11 @@ pub const Display = struct {
41644164
}
41654165
}
41664166

4167+
/// When the user is dragging a scrollable panel, it starts with an offset
4168+
/// `value` of zero. If the panel overflows its box, then the offset
4169+
/// value may decrease to the `min` offset or increase to the `max` offset.
41674170
fn limit_scroll(min: f32, value: f32, max: f32) f32 {
4171+
std.debug.assert(min <= max);
41684172
if (value < min) return min;
41694173
if (value > max) return max;
41704174
return value;

0 commit comments

Comments
 (0)