summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'graphics')
-rw-r--r--graphics/src/widget/canvas.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/graphics/src/widget/canvas.rs b/graphics/src/widget/canvas.rs
index 157aa25c..65d7e37e 100644
--- a/graphics/src/widget/canvas.rs
+++ b/graphics/src/widget/canvas.rs
@@ -211,6 +211,11 @@ where
use iced_native::Renderer as _;
let bounds = layout.bounds();
+
+ if bounds.width < 1.0 || bounds.height < 1.0 {
+ return;
+ }
+
let translation = Vector::new(bounds.x, bounds.y);
let cursor = Cursor::from_window_position(cursor_position);