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 761286 - librsvg detects wrong dimension on rotated rectangle
librsvg detects wrong dimension on rotated rectangle
Status: RESOLVED DUPLICATE of bug 760112
Product: librsvg
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: librsvg maintainers
librsvg maintainers
Depends on:
Blocks:
 
 
Reported: 2016-01-29 13:19 UTC by Jehan
Modified: 2017-08-29 22:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Rotated rectangle in Inkscape. (125.02 KB, image/png)
2016-01-29 17:38 UTC, Jehan
Details

Description Jehan 2016-01-29 13:19:18 UTC
Another inconsistent response of rsvg_handle_get_(position|dimensions)_sub() (see also bug 761264 and bug 760112 for other similar cases).

Steps:
1/ Create a rectangle in Inkscape on a blank page. For instance, I made a 200x50 rectangle.

2/ Inspect with rsvg API, it returns me dimension 200x49 and position (174, 235), which is nearly OK (the ordinate is not the same as Inkscape, but it seems this is because Inkscape shows coordinates from bottom left corner instead of top left). The width though is 1 pixel off. Which is already annoying, especially since the rectangle is exactly 50 pixels wide. No approximation should lead to losing a pixel. Here is the SVG code (there is no transformation made on parent nodes):

    <rect
       style="opacity:0.38500001;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.214;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       id="rect7381"
       width="200"
       height="50"
       x="174.28572"
       y="235.21936" />

3/ Now I apply a rotation. According to Inkscape, I should get a box 177x177 (cf. screenshot).

4/ Check again with libsrvg API, I get a 353x353 box at position (97, 83). Both dimensions and positions are completely wrong.

The SVG code is:

<rect
       style="opacity:0.38500001;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.214;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       id="rect7381"
       width="200"
       height="50"
       x="-90.053581"
       y="352.95218"
       transform="matrix(0.70710678,-0.70710678,0.70710678,0.70710678,0,0)" />

There is still no transformation on any parent node of this rectangle.
Comment 1 Jehan 2016-01-29 13:24:32 UTC
Also tested and issue confirmed on git master from today.
Comment 2 Jehan 2016-01-29 17:38:24 UTC
Created attachment 320027 [details]
Rotated rectangle in Inkscape.

Oups I forgot to attach my screenshot earlier. It just shows the rectangle in Inkscape, and the expected box size.
Comment 3 Federico Mena Quintero 2017-08-29 22:43:34 UTC

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