summaryrefslogtreecommitdiffstats
path: root/tiny_skia/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-01-31 21:21:38 +0100
committerLibravatar GitHub <noreply@github.com>2024-01-31 21:21:38 +0100
commit6bf34b074667e5e025de1e352a34ce255bc7e26e (patch)
tree0399146e9b9a5f7b6ff8a6c802c2952d6d192dda /tiny_skia/src
parent66c8a804c6b665718a2cc80222ba8b906b543014 (diff)
parentd9b7090936b7e477d9b64087d4eedc3708ff0e86 (diff)
downloadiced-6bf34b074667e5e025de1e352a34ce255bc7e26e.tar.gz
iced-6bf34b074667e5e025de1e352a34ce255bc7e26e.tar.bz2
iced-6bf34b074667e5e025de1e352a34ce255bc7e26e.zip
Merge pull request #2082 from joshuamegnauth54/issue2066
Assert dimensions of quads are normal in `iced_tiny_skia`
Diffstat (limited to 'tiny_skia/src')
-rw-r--r--tiny_skia/src/backend.rs9
1 files changed, 9 insertions, 0 deletions
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) {