- When editing the nodes of an objectBoundingBox gradient, it remains in
objectBoundingBox coordinates in the XML representation, but with no
visual
change in behaviour. 2) When moving or resizing an object associated with an objectBoundingBox gradient, the gradient's XML representation remains unchanged.
Strictly speaking, these two requirements are incompatible. When you rotate or skew an object, an objectBoundingBox gradient has to be modified in a non-obvious way so that it transforms with the object.
Understood. I would do a simple first-pass by just making it work in non-rotated-or-skewed scenarios. Those scenarios are my biggest source of surprise & annoyance -- for eg when I simply shift an object to a different place on the canvas, I find it surprising that I've messed up my gradient type. But if I rotate or (especially) skew, I can accept that things will not be as simplistic.
That said, I'm vaguely imagining that it would be a case of doing the necessary calculations in userSpace coordinates (or canvas coordinates), and converting back to boundingBox coordinates via the transform matrix etc. Perhaps I'll find out it's not so straightforward when I get to it.
The relevant places are:
Thanks!
- Bryan