"Tiled Clones" inside transformed groups broken

Bug #168651 reported by jimmac
This bug affects 34 people
Affects Status Importance Assigned to Milestone
Fix Released

Bug Description

When changing the document size with the 'fit page to selection' buttons,
the object centers appear to be shifted.

Below is a demo recording of the bug exposing itself in the clone tiler.


Revision history for this message
Peter Moulder (pjrm) wrote :

Originator: NO

Given a choice between just a textual description of how to reproduce and
what the expected vs actual behaviour is, or just a video, I'd actually
prefer just the textual description. Indeed, I didn't manage to reproduce
exactly the behaviour shown in the video. (The video didn't show what
clone tiling settings were in use, and didn't start with launching inkscape
with ~/.inkscape moved out of the way.)

Here is a textual description of something similar that I have
Start inkscape.
Draw a rectangle.
Edit>Clone>Create Tiled Clones...
Set Rows, Columns to (say) 6, 1.
Choose the Rotation tab and set Per row to 15°.
Click the Create button.
Note that the resulting clones' centres all lie on a vertical line.

Ctrl+Shift+D (Document Properties)
Click Fit page to selection.
Click the Create button (on the Create Tiled Clones dialog) again.
Note that this time the resulting clones' centres do not all lie on one
vertical line.

The same occurs (i.e. not aligned to a vertical line) if, instead of Undo,
I exit inkscape, rm -rf ~/.inkscape, start Inkscape, draw a rectangle,
Ctrl+Shift+D and Fit page to selection, Edit>Clone>Create Tiled Clones and
so on.

If I start Inkscape, create a rectangle, save, Fit page to selection, save
as a different file, exit, and try the same clone tiles operation on each
(exiting and rm -rf ~/.inkscape between the two), then again the normal one
is vertical and the file whose canvas was fit to selection is non-vertical:
so the behaviour can be reproduced from loaded files rather than requiring
memory state.

Doing a diff between the two input files, the main difference is that the
fitted one's "Layer 1" group has a
transform="translate(-162.35715,-174.71933)" attribute.

So I think the first question is what transformation clonetiler_apply
should apply when the selection is in an affine-transformed group/layer.
I'll assign to buliabyak (main author of Clone Tiling and
dialogs/clonetiler.cpp) to decide on that one.

A second question is how Fit canvas to selection should implement its
translation step, whether adding a transform attribute to the group as it
does now or whether to go more deeply. If the latter, then how deeply? If
fully deeply, then beware of issues with objects in a group being cloned
(especially if that group has a rotation transformation): need to be
careful about how to adjust the clone's transform.

I've assigned this a relatively low Priority for the moment, though I
don't object to increasing it to as much as 6.

Ryan Lerch (ryanlerch)
Changed in inkscape:
assignee: buliabyak-users → buliabyak
status: New → Incomplete
Revision history for this message
fig_wright (fig-wright) wrote :

I have this bug also. It seems to be because using 'fit page to selection' causes the page to shrink, and the object then shrinks with it.

Revision history for this message
Tom Davidson (tjd-mit) wrote :

fig_wright: If you are seeing objects shrinking on resize, then your issue sounds more like bug 168410 ( https://bugs.launchpad.net/inkscape/+bug/168410 ).

Revision history for this message
Thomas Holder (speleo3) wrote :

bug 168410 is fixed and addresses a different issue.

The proper description for this one is: "Tiled Clones" inside transformed groups broken. As "Fit page to selection" translates layer groups, it is likewise affected.

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

Confirmed with Inkscape 0.46+devel r22240 on OS X 10.5.8 using <http://launchpadlibrarian.net/30250613/clone_bug.svg> from bug #213793 (closing originating as fixed and adding unrelated example from its comments here because #213793 as reported is not a duplicate of this bug).

From bug #213793:

comment #10:

Steps to reproduce:
* Open the attached 'clone_bug.svg';
* Select the red bar in the center of the page;
* Create Tiled Clones: 2 rows, 1 column; 'exclude tile' for row/column on the 'shift' tab; put 90 degree on row in the 'rotation' tab;
* This should create a red cross, but instead the cloned object is placed elsewhere.

comment #11:

If you remove the 'transform="translate(0,-352.36218)"' attribute from the group 'Layer 1" in 'clone_bug.svg' - the 'Tiled Clones…' work as expected. The translate attribute gets added e.g. when you resize the page in 'Document Properties'.

Changed in inkscape:
status: Incomplete → Confirmed
summary: - 'fit page to selection' affecting tranf. centers
+ "Tiled Clones" inside transformed groups broken
Revision history for this message
Kjohrf (kjohrf) wrote :

Just lobbying for raised priority on this. It affects multiple people. Note that I do not use "fit page to selection" as the original bug poster does. All I did is set the page size to Letter.

su_v (suv-lp)
Changed in inkscape:
importance: Low → Medium
Revision history for this message
Denilson Sá (denilsonsa) wrote :

Still unfixed in 0.47. It's not good for the users to spend a lot of time trying to figure out why all tiled clones are completely wrong, when that's expected to be a simple and useful feature.

Revision history for this message
nevit (nevilo) wrote :

I have a copy of Inkscape 4.5 and it works fine there. I do not know programming but some diff comparison between codes of two versions can spot what has changed and why it goes wrong now.

su_v (suv-lp)
tags: added: clones groups
removed: all-platforms
Revision history for this message
SCYG (s-cygielski) wrote :

When changing page size a transform attribute is added to layers - this confuses the tiled clone feature. Although the workaround described by ~suv works, this kind of thing really weighs on non-technical users' experience with Inkscape, whcih is a shame. This bug should receive high priority - either the translate attribute should not be added on page resize, or tiled clones should compensate for it.

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

We came across this issue today and it took some time to figure out what's going on with tiled clones after changing the canvas size. It's really annoying, even though ~suv's workaround still works for e.g. 0.48.0 (four years after the first report of this issue).

What's the exact purpose of the transform property that is added to the svg after canvas size change? And why is it used by the tiled clones function? Is it a bug or a feature?

Revision history for this message
bluebomber (bluebomber) wrote :

Good question, Christoph. I'd like to help with this if I could.

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

Christoph's questions are beside the point IMHO (the behavior of clones needs to be fixed when inside transformed groups, not what happens when changing the page size/orientation) and beyond the scope of the bug tracker (ask on one of the inkscape mailing lists).

Nevertheless, some notes:
a) There is a reason why the transformation is added to top-level layers/groups when the origin of the GUI coordinate system is changed. Could it be done differently? Possibly, but that's not what this bug is about (see bug summary).
b) The transform attribute of the parent layer/group is not "used by the tiled clones function": clones (tiled or not) are affected when they are inside a transformed group (see bug summary), because apparently the compensation of parent transforms is not fully implemented [1].

[1] <https://bugs.launchpad.net/inkscape/+bug/479638/comments/7>

Revision history for this message
Ernst-gumpinger-w (ernst-gumpinger-w) wrote :

Clones are also shifted when copied with their master object, after fit page to selection.

How to reproduce:

1) open a new file, create a simple path, e.g. a two nodes bezier curve

2) create a clone of the path

3) fit page to selection in document properties (crtl + shift + d)

4) copy both the path and it's clone (ctrl + c)

5) paste the anywhere on the document (ctrl + v)

result: the copied elements have have different relative positions one to another.

The bug is not produced when usind the "duplicate" tool (ctrl+d).

It is also due to the "transform=translate" in the layer section, added after the page resize. Removing it solves the problem, though the objects are shifted elsewhere on the canvas.

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

On 2015-02-18 22:02 (+0100), Ernst-gumpinger-w wrote:
> Clones are also shifted when copied with their master object, after
> fit page to selection.

@Ernst - please refrain from adding comments in this report (bug #168651) about what seem to be similar issues - most are already traced in separate reports (and fixes for those which have been committed recently to trunk do not fix this one).

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

@Ernst-gumpinger-w - more specifically: displacement on paste is tracked in bug #1152657 (not fixed yet).

Revision history for this message
Mc (mc...) wrote :

patch attached

su_v (suv-lp)
Changed in inkscape:
assignee: bbyak (buliabyak) → Mc (mc...)
milestone: none → 0.92
status: Triaged → In Progress
Revision history for this message
su_v (suv-lp) wrote :

Summary of tests with 0.91+devel r13926+patch from comment #16, as discussed with Mc on irc:
1) Available test cases with displaced clones for 'Rotation' and 'Scale Y': the position of each of the created clones is as expected
2) If the original tile has a transformed rotation center, the rotation center of each of the created clones is offset (but the position itself of each clone is as expected)
3) The patch does not handle displaced clones created in 'Trace' mode affecting the 'size' of the clones. The related reports have been unlinked from this one (bug #168651) and are now tracked in bug #469885 (and duplicates).

Revision history for this message
Mc (mc...) wrote :

Transformation center handled.
Additional note : there is an unrelated bug about transformation center being moved for clones, with a non-px document

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

Fix for rotation center of the (rotated) clones (in a new document originally based on 'default px') confirmed with Inkscape 0.91+devel r13926+168651_2.diff on OS X 10.7.5.

The incorrect placement of the transformation center in documents with a different drawing scale (e.g. trunk's new default templates with width="210mm", height="297mm" and viewBox="0 0 210 297") needs to be addressed separately (not related to the bug tracked here).

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

Second version of the patch committed to trunk in r13929 - thanks a lot, Mc!

Changed in inkscape:
status: In Progress → Fix Committed
tags: added: backport-proposed
Revision history for this message
su_v (suv-lp) wrote :

Would be nice to have backported to the stable release branch (lp:inkscape/0.91.x) if feasible.

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

Re backporting: if feasible at all, probably also needs to include the later changes in r13935.

Revision history for this message
ScislaC (scislac) wrote :

~suv: I applied the diff from r13929 to 0.91.x and while it improves result, it is not fixed. Also, the changes in 13935 apply to functions that don't exist in 0.91. I'm thinking this won't be backported (especially because of the sped up timeline for 0.92).

Revision history for this message
ScislaC (scislac) wrote :

Per ~suv's instructions on IRC, by disabling "Use saved size and position of the tile" it did indeed fix it.

trunk r13929 backported in 0.91.x r13759

Changed in inkscape:
milestone: 0.92 → 0.91.1
tags: removed: backport-proposed
jazzynico (jazzynico)
Changed in inkscape:
milestone: 0.91.1 → 0.92
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