Rotation center moves on copy when units are mm (rev >= 12554)

Bug #1247799 reported by LucaDC
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Diederik van Lierop

Bug Description

I have problems when working with mm as default unit:
 - draw a rectangle;
 - move its rotation center to, for example, a corner;
 - ctrl-c, ctrl-v to duplicate the rectangle (when duplicating with ctrl-D the problem is not present);
 - the rotation center of the new object is not in the original position.

Rev. 12774.

Revision history for this message
su_v (suv-lp) wrote :

Not reproduced with Inkscape 0.48.4 on OS X 10.7.5.
Reproduced with trunk (with all available builds on this system: oldest tested revision is 10795, latest is 12777).

All trunk tests done with new default prefs in a new document based on the current 'A4' template (uses 'mm' as default units).

tags: added: regression selection transformations
su_v (suv-lp)
Changed in inkscape:
importance: Undecided → Medium
milestone: none → 0.49
status: New → Confirmed
Revision history for this message
jazzynico (jazzynico) wrote :

Also reproduced on Windows XP, Inkscape trunk revision 12840.

Changed in inkscape:
status: Confirmed → Triaged
Revision history for this message
su_v (suv-lp) wrote :

Happens in stable too, if document uses viewBox attribute:

$ diff 1247799-A4-no-viewBox.svg 1247799-A4.svg
12c12,13
< height="297mm">
---
> height="297mm"
> viewBox="0 0 210 297">

Trunk adds a viewBox attribute if the default units are changed since revision 12554.

tags: added: viewbox
summary: - Rotation center moves on copy when units are mm
+ Rotation center moves on copy when units are mm (rev >= 12554)
Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

This should have been fixed as of rev. 13452

Changed in inkscape:
status: Triaged → Fix Committed
assignee: nobody → Diederik van Lierop (mail-diedenrezi)
Revision history for this message
LucaDC (lucadc) wrote :

Hi Diederik,
thanks for trying to fix this bug but I still experience it with a variation: after cltr-c ctrl-v there is a big y offset (around -200 and more mm) and a smaller x offset; both depend on where the center is moved with regards to its original position but the y offset is always around 200 and the x small.
Duplicating with ctrl-d still works as before.
Very annoying as to reset the center to its original position you first have to find it!

Windows XP, mm as default unit, also with default preferences.

Revision history for this message
su_v (suv-lp) wrote :

Reopening based on comment #5 (reproduced as described with r13469 on OS X 10.7.5).

Changed in inkscape:
status: Fix Committed → Triaged
Revision history for this message
Alvin Penner (apenner) wrote :

- running Windows XP, Inkscape rev 13470
- there is a scaling problem here that exists independently of the copy/paste operation, and will probably need to be fixed before the copy/paste can be fixed. In a rectangle, the parameters inkscape:transform-center-x/y do not scale the same as the parameters width, height, x, y when the document units are changed.

attached is the file rect_px.svg. It uses px as document units. Now load the file, convert document units to mm, and save it as rect_mm.svg. Now compare the two rectangles.

In rect_px.svg we have:
    <rect
       width="270"
       height="110"
       x="70.499992"
       y="181.86218"
       inkscape:transform-center-x="135"
       inkscape:transform-center-y="55" />

In rect_mm.svg we have:
    <rect
       width="76.200005"
       height="31.044445"
       x="19.896666"
       y="51.32555"
       inkscape:transform-center-x="134.99999"
       inkscape:transform-center-y="54.999998" />

The parameters x, y, width, height have been scaled by a factor of .2822 as expected. The parameters inkscape:transform-center-x/y are unchanged, which is inconsistent. It would probably simplify the logic to make sure that all parameters are scaled at the same time. The problem with these 2 parameters is that they are not actually present if they are at the default value, so it is easy to overlook them.

Revision history for this message
Alvin Penner (apenner) wrote :

second file

Revision history for this message
LucaDC (lucadc) wrote :

Just a (probably superfluous) note to clarify that the problem does not affect rectangles only but also circles, paths and most likely all other objects.

Revision history for this message
su_v (suv-lp) wrote :

Follow-up report (regression):
- Bug #1352554 “trunk: moving object transformation center and flipping causes object to move away from center (>=13452)”
  <https://bugs.launchpad.net/inkscape/+bug/1352554>

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

I believe that this has been properly fixed as of rev. #13521.

The rotation center will still shift though if the document units are changed in between copying and pasting, or when importing from e.g. a document in px to a document in mm (which is a similar operation as copying and pasting). This is too difficult to fix, and is not a regression, both being reasons to give this a low priority.

The whole transformation center thing is broken by design anyway IMHO...

su_v (suv-lp)
Changed in inkscape:
status: Triaged → Fix Committed
Revision history for this message
LucaDC (lucadc) wrote :

Tested with rev. 13537 and it works correctly.
Thanks.

Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.