diff options
author | 2022-03-07 15:36:09 +0700 | |
---|---|---|
committer | 2022-03-07 15:36:09 +0700 | |
commit | fbbb864aaa7d4163ffea9ccd39d8097568253c3e (patch) | |
tree | 0b000c1091b6f6b8fe060b0c9fbf542a4654f68d /graphics/src/widget/canvas.rs | |
parent | c35496d80fc542c9beeea39dec98eb5cdef07aaa (diff) | |
parent | 4411da25cfcfddab138dadd05e92f9bd4db1b763 (diff) | |
download | iced-fbbb864aaa7d4163ffea9ccd39d8097568253c3e.tar.gz iced-fbbb864aaa7d4163ffea9ccd39d8097568253c3e.tar.bz2 iced-fbbb864aaa7d4163ffea9ccd39d8097568253c3e.zip |
Merge branch 'master' into virtual-widgets
Diffstat (limited to 'graphics/src/widget/canvas.rs')
-rw-r--r-- | graphics/src/widget/canvas.rs | 5 |
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); |