simple edit of gradient creates new gradient (duplicates)

Post questions on how to use or achieve an effect in Inkscape.
User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

simple edit of gradient creates new gradient (duplicates)

Postby brynn » Mon Jul 23, 2012 10:42 pm

Hi Friends,
Unfortunately, I have not figured out how to reproduce this. Sometimes it happens and sometimes it doesn't. I've made a simple file for testing, so I'm hoping other folks might be able to spot the problem. Or maybe someone has had this happen to them. Or maybe I'm just not doing something right??

Sometimes when I make a simple edit to a gradient, it creates an entirely new gradient. It's as if I've duplicated the gradient, except that I didn't, not on purpose anyway. It's identical to the original, except for whatever change I had made, that caused it to happen.

I usually don't notice that a new gradient was created, because it looks identical to the original, except for its number on the control bar. When I do notice that it has happened, it's because I have the Gradient Editor open. I go to make changes using the editor, rather than the canvas, and it has no effect (because the gradient was inadvertently duplicated some steps back, and the editor that's open was for the original gradient). That's when I look to the control bar. If I undo back some steps, then the gradient number changes back at the point where the new one was created. I suspect that this has happened many times, when I never did notice it was happening. Here are details:

  • In Inks Prefs > Misc, I have "Prevent sharing of gradient definitions" checked.
  • When I edit gradients, I sometimes have the Gradient Editor open, and sometimes I don't. The problem happens whether it's open or not.
  • I use the editor mostly for adding stops. (Despite the fact that you're supposed to be able to add gradient stops by double-clicking on the gradient handle, it hardly ever works for me. I'm not sure why, so I'm still using the editor, even though it's slated to be discontinured. Occassionally I also use it to place the stops precisely, as I continue to find that difficult on the canvas, as well.)
  • Things that trigger a new gradient (or a duplication of a gradient) include moving a stop, moving a handle, and changing the color or opacity of a stop.
  • It can happen whether I'm moving a stop with the mouse or with the Gradient Editor.
  • Sometimes I change a stop color by pasting a color code into Fill and Stroke dialog (that I had copied, usually from another stop) while stop is selected. And sometimes I change a stop color using the Dropper tool, while stop is selected. And sometimes I change a stop color in the F/S dialog by changing HSL values, while stop is selected. Any of those might cause this problem.
  • When I change the opacity of a stop, I always use the opacity indicator beside F/S indicators in bottom left corner of window, while stop is selected. That can also cause this problem.
  • It happens no matter which tool might be engaged -- Gradient, Dropper, or Node tool

Note that I have reproduced it twice using this file, but I used Undo afterwards, so you won't see the new gradients in the list. But as soon as I can make it happen again, I'll save, so the new gradient is saved. (And then I'll upload that new file.) There's nothing special about these gradients. I just made a couple of rectangles with bright colored gradients. In the file where I'm working on a large and complex image, at the moment, I can't edit any gradient at all, without a duplicate being created -- very frustrating, and thank goodness for Vacuum Defs, lol :D

possgradientbug.svg
(5.13 KiB) Downloaded 171 times


Thanks for any comments :D

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: simple edit of gradient creates new gradient (duplicates

Postby brynn » Tue Jul 24, 2012 2:37 am

Ok, I can't reproduce this issue in the file that I posted, but it's happening in a different file, that's simple enough to submit.

Please look at path3030, which is the object with the bright green stroke. (The stroke is not part of the image, but I just added it to identify the object.) It's currently filled with gradient #15703. It just became gradient #15703 after I changed the opacity of end stop #15713 from 50% to 20%. Before I changed the opacity of that stop, it was gradient #15276, and that stop was #15280.

So I'll put it in chronological order.

path3030:
-- filled with gradient #15276
-- end stop #15280 has opacity 50%
-- select that stop (w/gradient tool, dropper tool, or node tool)
-- change opacity to 20% (in O: opacity indicator bottom left corner of window)
-- gradient is apparently duplicated, and immediately becomes gradient #15703
-- and the end stop becomes #15713

Shouldn't it be possible to edit a gradient, without it being duplicated, or creating a new identical gradient? Is it something I'm doing? Is it a bug?

This is Inkscape 0.48.1 on Win7, 64-bit.

I know that you can't use the back button to see what happened. But this file at least has identifiable elements which you can follow with my description. Or I don't know, maybe there would be some evidence in XML Editor??

Thanks for your help :D

bomb-pop.svg
(13.49 KiB) Downloaded 149 times

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: simple edit of gradient creates new gradient (duplicates

Postby ~suv » Tue Jul 24, 2012 4:07 am

brynn wrote:Shouldn't it be possible to edit a gradient, without it being duplicated, or creating a new identical gradient? Is it something I'm doing?

If you want to use shared gradients, and keep them shared even if you edit one instance of them: uncheck the preferences setting which prevents sharing of gradients:
brynn wrote:In Inks Prefs > Misc, I have "Prevent sharing of gradient definitions" checked.
If that setting is active (default), a gradient (sharing the same color definition with multiple objects) is forked at the moment you edit the color and/or transparency of one of the gradient stops.

Note: this setting does not affect that gradients are always forked when copy&pasting objects with gradients within the same document (this cannot be disabled).

See also: Re: about sharing gradients between/among objects

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: simple edit of gradient creates new gradient (duplicates

Postby brynn » Tue Jul 24, 2012 7:42 pm

Oooooh, I think I understand what you're saying. In the bomb-pop file, at least 2 of the objects use the same gradient. Since I have the setting enabled to prevent sharing gradients, Inkscape won't allow them to have the same gradient? So if I edit one of them, it has to be automatically duplicated. Is that it?

The reason I have that option enabled, is because I used to become so frustrated if I duplicated an object with a gradient, and then edited the duplicate object's gradient, it would also change the original. In the large file I'm working on, I did not realize that gradient was shared with another object. And I'll still have to look around, to be sure. But I am sure about the bomb-pop file.

In the case of the bomb-pop file, I didn't have the gradient shared on purpose. It was really just convenience. In the end, I intend the objects currently sharing the gradient to have different gradients. But every now and then, I do want 2 objects to share the same gradient. Couldn't there be some way, when we duplicate an object, to have the gradient duplicated at the same time? Then we wouldn't need the prevent sharing gradients setting, and we could have shared gradients if we want, and not have to worry about duplicated objects getting changed when the duplicate's gradient is editted. That seems like a much more flexible alternative, than the current global setting.

Oooh, I just remembered. The object in the large file had been a stroke with a gradient paint. Just before I started to edit the gradient, I had applied Stroke to Path. Did that effectively create a shared gradient situation?

And one last question. If an object is filled and stroked with the same gradient, is that considered a shared gradient? Or is a shared gradient only among/between different objects?

Thanks ~suv :D


Return to “Help with using Inkscape”