Moving clone parent causes child gradient misalignment

Bug #1439307 reported by Lucian
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

Steps to reproduce

1) Create a square, give it an undefined fill
2) Clone the square, give the clone a linear gradient fill
3) Move the original square along the x axis.

Expected result

The original square should move, and the clone + its gradient should stay where they are

Actual result

The clone stays where it is, but the gradient is moved by the opposite vector to that by which the original was moved. Inkscape is applying a transformation to the clone to account for the fact that it is now in a different position relative to its parent. Unfortunately, the gradient's position is defined independently of the original square by co-ordinates on its own definition. When you move a normal shape containing a gradient, inkscape knows to add a gradientTransform to shift it along with the shape (assuming you have that option turned on) but it isn't currently clever enough to recognise that moving the parent of a clone which uses a gradient is effectively moving the shape because it is changing the user co-ordinate system of the clone even if it isn't actually moving on the canvas. I guess Inkscape needs to add a gradientTransform attribute in this case as it would do when moving a normal gradient filled object. I would suggest that this should happen irrespective of whether "Move gradients along with the objects" is set, since the user is not actually trying to move the object to which the gradient is applied.

Conversely, if you change the setting of "Moving original: clones and linked offsets" in preferences then the opposite happens - the clone moves beyond its own gradient ignoring the value of the "Move gradients along with the objects" setting. Again, it needs a gradientTransformation to keep things lined up.

Ii guess this is a bit of an edge case since the position of parent objects with undefined fills is not usually particularly significant - they tend to stay hidden - but it's confusing and it can be quite frustrating if you move the parents by accident.

Attachment shows a pair of rectangles that exhibit the problem. Move the top one left and right to see the effect.

Tested on 0.91 Mac OS 10.10.2.

Revision history for this message
Lucian (lucian-j) wrote :
Lucian (lucian-j)
description: updated
su_v (suv-lp)
tags: added: clones gradient
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.