fix overflowing sub assertion in debug mode

This commit is contained in:
Wez Furlong committed 2023-03-27 19:24:30 -07:00
1 parent 407b1297eb
commit 8ea49ab69f
1 file changed
+2 -1
+2 -1
View File
@@ -38,7 +38,8 @@ impl ScrollHit {
let scroll_percent =
1.0 - (scroll_top / (render_dims.physical_top - render_dims.scrollback_top) as f32);
let thumb_top = (scroll_percent * (max_thumb_height - thumb_size) as f32).ceil() as usize;
let thumb_top =
(scroll_percent * (max_thumb_height.saturating_sub(thumb_size)) as f32).ceil() as usize;
Self {
top: thumb_top,