After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 761264 - librsvg detects crazy dimension for rectangles with stroke-width <= 0.5
librsvg detects crazy dimension for rectangles with stroke-width <= 0.5
Status: RESOLVED DUPLICATE of bug 760112
Product: librsvg
Classification: Core
Component: general
2.40.x
Other Linux
: Normal normal
: ---
Assigned To: librsvg maintainers
librsvg maintainers
Depends on:
Blocks:
 
 
Reported: 2016-01-28 20:29 UTC by Jehan
Modified: 2017-08-29 22:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jehan 2016-01-28 20:29:31 UTC
I have a <rect> with the following code:

      <rect
         y="1046.7383"
         x="9.4698935"
         height="2.2477121"
         width="2.2477121"
         id="rect3933-15"
         style="opacity:0.5;fill:#bebebe;fill-opacity:1;stroke:#bebebe;stroke-width:0.25228789;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />

The expected size is 2x2, and the position (829, 280) in this particular file. But rsvg_handle_get_position_sub()/rsvg_handle_get_dimensions_sub() returns me crazy numbers 11x1048 (820, -766).

As soon as I change the stroke-width parameter over 0,5, or if I disable the stroke (stroke:none), I get expected numbers.

Obviously a stroke under 1px is meaningless (Inkscape allows these. I guess it still make sense since the vectorial drawing can be scaled up infinitely), but it should not break librsvg anyway.
In any case, this follows SVG spec where numbers can be floats.
Comment 1 Massimo 2016-02-17 18:55:57 UTC
This seems to be the same problem causing bug #739916.

I added a comment there showing a cause, but
the fact that to compute the object bounding box
librsvg sets the cairo tolerance to 1.0 certainly
does not help getting accurate dimensions and/or positions.

see:

https://git.gnome.org/browse/librsvg/tree/rsvg-cairo-draw.c#n484

the comments there also explain that GNOME symbolic icons
work around these shortcomings adding a <rect /> per icon
not stroked nor filled to compute the bounding box.
Comment 2 Federico Mena Quintero 2017-08-29 22:44:48 UTC

*** This bug has been marked as a duplicate of bug 760112 ***