Stroke bounding box for stroke:none is wrong
The stroke bounding box (also, transform-box:stroke-box
) of an element with stroke:none; stroke-width:10;
must take into account the stroke width. Currently librsvg does not compute a stroke bounding box if an element has stroke:none
let stroke_extents = if !stroke.width.approx_eq_cairo(0.0)
&& !matches!(stroke_paint_source, PaintSource::None)
{
let (x0, y0, x1, y1) = cr.stroke_extents()?;
Some(Rect::new(x0, y0, x1, y1))
} else {
None
};
This may produce different behavior for apps that call get_position_sub
/ get_dimensions_sub
/ get_geometry_for_layer
/ get_element_geometry
, if they were expecting that elements with stroke:none
don't have their stroke width taken into account.
I'm putting this in the 2.56.0 milestone to have a few months to notify app authors of this change in advance.