From 416641b1db604586979ff465a9539c3091f8ca2b Mon Sep 17 00:00:00 2001 From: Faris Tristan Fabian Date: Wed, 14 Oct 2026 11:59:59 +0700 Subject: [PATCH] fix(usvgr): name the clip path and mask in the zero-sized element warnings --- crates/usvgr/src/parser/clippath.rs | 6 +++++- crates/usvgr/src/parser/mask.rs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/usvgr/src/parser/clippath.rs b/crates/usvgr/src/parser/clippath.rs index ff4bad914..cc6be0e74 100644 --- a/crates/usvgr/src/parser/clippath.rs +++ b/crates/usvgr/src/parser/clippath.rs @@ -44,7 +44,11 @@ pub(crate) fn convert( let object_bbox = match object_bbox { Some(v) => v, None => { - log::warn!("Clipping of zero-sized shapes is not allowed."); + log::warn!( + "Clip path '{}' cannot be applied to a zero-sized element \ + (it uses objectBoundingBox units). Skipped.", + node.element_id() + ); return None; } }; diff --git a/crates/usvgr/src/parser/mask.rs b/crates/usvgr/src/parser/mask.rs index f3b114dbc..7967a753f 100644 --- a/crates/usvgr/src/parser/mask.rs +++ b/crates/usvgr/src/parser/mask.rs @@ -113,7 +113,11 @@ pub(crate) fn convert( let object_bbox = match object_bbox { Some(v) => v, None => { - log::warn!("Masking of zero-sized shapes is not allowed."); + log::warn!( + "Mask '{}' cannot be applied to a zero-sized element \ + (its content uses objectBoundingBox units). Skipped.", + node.element_id() + ); return None; } };