From cdc42d64643585780f4868b68e3e1a3a706efcc6 Mon Sep 17 00:00:00 2001 From: Josh Megnauth Date: Thu, 14 Sep 2023 01:25:40 -0400 Subject: Assert dimensions of quads are normal in `iced_tiny_skia` --- tiny_skia/src/backend.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tiny_skia') diff --git a/tiny_skia/src/backend.rs b/tiny_skia/src/backend.rs index ea4a3ec6..468bcb7e 100644 --- a/tiny_skia/src/backend.rs +++ b/tiny_skia/src/backend.rs @@ -155,6 +155,15 @@ impl Backend { border, shadow, } => { + debug_assert!( + bounds.width.is_normal(), + "Quad with non-normal width!" + ); + debug_assert!( + bounds.height.is_normal(), + "Quad with non-normal height!" + ); + let physical_bounds = (*bounds + translation) * scale_factor; if !clip_bounds.intersects(&physical_bounds) { -- cgit