copy and paste of a clone yields the wrong size if source and destination have different document units

Bug #1679428 reported by Alvin Penner
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Alvin Penner

Bug Description

this is similar to https://bugs.launchpad.net/inkscape/+bug/1423477
but not quite the same because the two objects (original and clone) are copied separately.

- Windows 10, Inkscape 0.92+devel 15614
- load the file source_mm.svg, which has document units of mm

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

- load the file dest_px.svg, which has document units of px

- copy and paste the top rectangle (which is the original) to the destination file, and note that it has the correct size
- copy and paste the bottom rectangle (which is the clone) to the destination file, and note that it is about 3 times too large

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

interrogation of the clipboard immediately after the two copy operations indicates that the error is probably happening during the copy. Below is the highly edited version of the clipboard after copying the original and the clone.
There are two significant differences:

1. the copy of the original has a <rect> tag outside the <inkscape:clipboard> tag, while the copy of the clone has a <rect> tag inside the <inkscape:clipboard></inkscape:clipboard> tag.

2. the copy of the original has a size of 377.95 with no extra transforms.
   the copy of the clone has a size of 100 with two additional transforms, one inside the <rect> element and one inside the <use> element. Both transforms have a scale of 3.7795276, so it is likely that one transform is redundant.

............................................
original copy (snipped)

  <inkscape:clipboard
     min="139.5,621.54725"
     max="518.45276,1000.5" />
  <rect
     height="377.95276"
     width="377.95276"
     id="rect3460" />

..................................................

clone copy (snipped)

  <inkscape:clipboard
     min="145.21429,121.54724"
     max="524.16705,500.5">
    <rect
       height="100"
       width="100"
       id="rect3460"
       transform="scale(3.7795276)" />
  </inkscape:clipboard>
  <use
     height="100%"
     width="100%"
     transform="matrix(3.7795276,0,0,3.7795276,5.7142859,500.00001)"
     id="use3462"
     xlink:href="#rect3460"
     y="0"
     x="0"
     style="" />

Revision history for this message
TylerDurden (8thrule) wrote :

Reproduced in Inkscape 0.92.1 r15371, win 8.1 64 bit.

Scale is precisely 3.77953 time too large. (Easy to view with fill and no stroke on original rectangle. See attached pic)

Possibly related to
https://bugs.launchpad.net/inkscape/+bug/1670913

Seeing similar issues with symbols, outsets and glyphs.

Regards,
TD

jazzynico (jazzynico)
Changed in inkscape:
status: New → Confirmed
importance: Undecided → Medium
tags: added: clipboard units
Revision history for this message
Alvin Penner (apenner) wrote :

fix committed to rev 15631

Changed in inkscape:
status: Confirmed → Fix Committed
assignee: nobody → Alvin Penner (apenner)
jazzynico (jazzynico)
Changed in inkscape:
milestone: none → 0.93
Revision history for this message
Christopher M. Rogers (cajhne) wrote :

Behaviour seems to have regressed in trunk.

Steps to reproduce:
1.Open new default A4 mm units document
2.Make a star
3.Clone the star
4.Cut and paste the clone of the star

Result: clone is pasted much smaller than the cut clone's size.

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

- unfortunately, I am no longer able to compile trunk on Windows, so I cannot test to see if the behavior has regressed. However I can confirm that the code that was part of this fix is still present in trunk, so if the behavior has regressed, then perhaps this is a new issue?

- the original fix was:
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/15631

- jftr could you attach a sample file illustrating the problem?
- also, just for clarity, did you 'cut and paste' or 'copy and paste'? I am quite sure that any testing I did was done using a 'copy and paste'.

Max Gaukler (mgmax)
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.