Skip Canvas::draw if bounds have no logical pixels

This commit is contained in:
Héctor Ramón Jiménez 2022-02-28 18:15:39 +07:00
parent af7cbf0003
commit 644c1b70ca
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

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