From f6daee14ac8f7cf090a5413ee1576aa59649a956 Mon Sep 17 00:00:00 2001 From: Ilia Malanin Date: Sun, 5 Jul 2026 14:06:04 +0200 Subject: [PATCH] fix: avoid panic on sub-pixel rounded borders --- tiny_skia/src/engine.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tiny_skia/src/engine.rs b/tiny_skia/src/engine.rs index 61323f04..9f0b54f2 100644 --- a/tiny_skia/src/engine.rs +++ b/tiny_skia/src/engine.rs @@ -263,6 +263,10 @@ impl Engine { } else { // Draw corners that have too small border radii as having no border radius, // but mask them with the rounded rectangle with the correct border radius. + if path_bounds.width < 1.0 || path_bounds.height < 1.0 { + return; + } + let mut temp_pixmap = tiny_skia::Pixmap::new( path_bounds.width as u32, path_bounds.height as u32,