aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/graphics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view/src/graphics.rs')
-rw-r--r--helix-view/src/graphics.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/helix-view/src/graphics.rs b/helix-view/src/graphics.rs
index a0b645fa..e813fb56 100644
--- a/helix-view/src/graphics.rs
+++ b/helix-view/src/graphics.rs
@@ -237,8 +237,8 @@ impl Rect {
Rect {
x: x1,
y: y1,
- width: x2 - x1,
- height: y2 - y1,
+ width: x2.saturating_sub(x1),
+ height: y2.saturating_sub(y1),
}
}