Merge pull request #1270 from iced-rs/skip-canvas-draw

Skip `Canvas::draw` if `bounds` have no logical pixels
This commit is contained in:
Héctor Ramón 2022-03-01 14:03:56 +07:00 committed by GitHub
commit ee6f4cb2ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);