gradient editing strangeness
![](https://secure.gravatar.com/avatar/b2f0153db3f32c156ae338127b8dda0b.jpg?s=120&d=mm&r=g)
Hello,
I *really* like the new "on canvas" gradient editing mode. However, the gradient editing still has a feature that I find puzzling. Maybe it's part of the svg standard or something and then it can't be changed I suppose.
When editing a linear gradient, the line between the handles seems like it should represent the actual direction of the gradient, but it doesn't, exactly, unless the object has a perfectly square bounding box. If the bounding box is rectangular, the only directions in which the line and the direction of the gradient are the same are horizontal and vertical; all other directions the gradient appears "sheared" ('m not sure if this is the correct term); it is not parallel to the line. (This is a bit hard to explain, perhaps I should make a screen shot to demonstrate what I mean?)
Even more confusing is the fact that this behaviour does not change even if the object is resized to have a square bounding box.
This sometimes makes it difficult, for example to fine-tune a gradient on a very long and thin object, depending on its orientation.
I don't know it I should report this as a bug or if there is some rational explanation :)
Cheers,
Johan Forsberg
![](https://secure.gravatar.com/avatar/bb65b6b3a109d97cf9f8d6c014ede042.jpg?s=120&d=mm&r=g)
On Fri, 11 Mar 2005 22:25:34 +0100, Johan Forsberg <johan.forsberg@...400...> wrote:
When editing a linear gradient, the line between the handles seems like it should represent the actual direction of the gradient, but it doesn't, exactly, unless the object has a perfectly square bounding box. If the bounding box is rectangular, the only directions in which the line and the direction of the gradient are the same are horizontal and vertical; all other directions the gradient appears "sheared" ('m not sure if this is the correct term); it is not parallel to the line. (This is a bit hard to explain, perhaps I should make a screen shot to demonstrate what I mean?)
I'm aware of this. It's just a thing from our past when we were using objectBoundingBox gradient coords. For objectBoundingBox, this behavior, weird as it may seem, is actually prescribed by the spec (yet another reason to never ever use objectBoundingBox!). When creating new gradients, they're currently still created with objectBoundingBox but get converted at once to userSpaceOnUse, which conversion emulates this weird behavior of objectBoundingBox to avoid gradient displacement. I think I'll be able to fix it easy enough by switching new gradients to use userSpaceOnUse from the start.
Even more confusing is the fact that this behaviour does not change even if the object is resized to have a square bounding box.
Not in my testing. I just tried it. I resize a box to square and now the handles and the actual gradient are always perpendicular.
![](https://secure.gravatar.com/avatar/bb65b6b3a109d97cf9f8d6c014ede042.jpg?s=120&d=mm&r=g)
On Fri, 11 Mar 2005 17:47:56 -0400, bulia byak <buliabyak@...400...> wrote:
I'm aware of this. It's just a thing from our past when we were using objectBoundingBox gradient coords. For objectBoundingBox, this behavior, weird as it may seem, is actually prescribed by the spec (yet another reason to never ever use objectBoundingBox!). When creating new gradients, they're currently still created with objectBoundingBox but get converted at once to userSpaceOnUse, which conversion emulates this weird behavior of objectBoundingBox to avoid gradient displacement. I think I'll be able to fix it easy enough by switching new gradients to use userSpaceOnUse from the start.
OK, I just fixed this in CVS. However this fix only works for new gradients that you create. Old gradients will behave the same as before, which is inevitable, otherwise we will break all the old SVG files (created in both Inkscape or Sodipodi). If you really need the new behavior for an object in an old file, you'll have to switch that object temporarily to flat color and then back to gradient.
participants (2)
-
bulia byak
-
Johan Forsberg