Inkscape Community

Help Using Inkscape => Inkscape Beginners' Questions => Topic started by: Marion on August 18, 2015, 11:01:27 PM

Title: why do i loose colors and gradients?
Post by: Marion on August 18, 2015, 11:01:27 PM
I had my page at A4 but drew outside the page. Tried to drag the selcted object into page and lost colors and gradients. Then i select it and did copy/paste, didnt loose the colors but the gradients are gone. What is the best way to keep everything as it is? I want the finished png at A4 format but drawing in A4 page itself is very small. [ You are not allowed to view attachments ]
Title: Re: why do i loose colors and gradients?
Post by: brynn on August 19, 2015, 12:10:39 AM
On the Selection tool control bar, you should probably click the last 3 buttons on the right.  They're pretty tiny, but they look like this:

 :srad:     :mgwo:     :mpo:

It's the middle one of those 3 that makes the gradient stay with the object.  But I've never had any occasion to unclick any of those 3.

Now the first of that group of 4 similar icons (the 4th from the right), I do change that from time to time.  But the other 3, I can't even imagine a situation where you would want those unclicked.

It's strange that your version came with those unclicked.  I think they should be clicked by default.  But maybe you were experimenting.
Title: Re: why do i loose colors and gradients?
Post by: Marion on August 19, 2015, 12:16:40 AM
i clicked 3rd icon and it works now. Should i leave that icon selected all the time now?
Title: Re: why do i loose colors and gradients?
Post by: brynn on August 19, 2015, 12:25:39 AM
It's probably a good idea.  Like I said, I can't even  imagine any situation where anyone would not want it engaged.  All those last 3 on the right should be engaged, or you will have the same problem with other things besides gradients.
Title: Re: why do i loose colors and gradients?
Post by: Marion on August 19, 2015, 12:28:19 AM
there is another one for patterns should that be engaged as well?
Title: Re: why do i loose colors and gradients?
Post by: brynn on August 19, 2015, 12:29:54 AM
Yes, that's the last one on the right.
Title: Re: why do i loose colors and gradients?
Post by: Marion on August 19, 2015, 12:31:56 AM
ok, thanks for now, hope to leave you in peace for a bit, back to studying :)
Title: Re: why do i loose colors and gradients?
Post by: brynn on August 19, 2015, 12:37:39 AM
No worries  :D
Title: Re: why do i loose colors and gradients?
Post by: Lazur on August 19, 2015, 04:21:14 AM
Worth mention that copy/paste creates a new gradient in the defs section of your file.
Usually duplicating the objects (Ctrl+D) works better -and faster too.
Title: Re: why do i loose colors and gradients?
Post by: Marion on August 19, 2015, 07:09:12 AM
Sorry...what does defs section mean?
Title: Re: why do i loose colors and gradients?
Post by: Lazur on August 19, 2015, 07:35:40 AM
It is related to the svg structure (http://tavmjong.free.fr/INKSCAPE/MANUAL/html/FileFormat-Default.html).
Gradients, pattern fills, custom markers, clipping paths are all stored in that part (http://tavmjong.free.fr/INKSCAPE/MANUAL/html/FileFormat-Defs.html) of the file. If you set it on an object, the information is linked. If you use copy/pasting, then the two objects will have two different data for their gradient/pattern fill/...
In my experience with 0.48 it was the most common reason for program crashes, that too many defs were stored.
Causes serious lagging at least.
Mostly related to a bug with the gradient editor, you could end up with thousands of unused gradients fast.
To manage this, there is an option in the file menu to cleanup document (previously vacuum defs), that deletes unused definitions. 


Well, other than duplicating, some cases you can use cloning (Alt+D) -if you want one kind of object repeated, and edit all the objects later on the same way.
Title: Re: why do i loose colors and gradients?
Post by: Marion on August 19, 2015, 08:10:32 AM
Thanks for explaining Lazur.
Title: Re: why do i loose colors and gradients?
Post by: brynn on August 20, 2015, 03:30:09 AM
The short explanation:  copy/paste (into the same document) adds extra data to the file.  (And as Lazur says, duplicating does not.)

I did the same thing when I was first learning to use Inkscape.  I started using Inkscape when I was brand new to any kind of graphics, not just vector graphics.  So copy/paste seemed to work, so I just used it.

But then I had some kind of other problem and I was posting a message to get help, and listed my steps.  And then someone asked me why I was using copy/paste and not duplicate, which is apparently kind of a standard way graphics programs work.  But of course, I had no clue about that!

Lazur, are those extra defs from copy/paste removed by Clean Up Document?  Or do they have to remain in place, to display the pasted content?

I actually didn't know copy/paste adds extra defs, and that duplicate does not.  (I do know about some other things that add defs.)  And I always have been curious what the difference is between them, except for how they work.  So I guess that's it  :)
Title: Re: why do i loose colors and gradients?
Post by: Lazur on August 20, 2015, 03:47:57 AM
Hmm checked that in 0.91, now copy/pasting doesn't duplicate gradient entry-s? Guess it has changed from 0.48, where it did. As far as I remember they could be vacuumed. Another guess is that the doubling of the gradients can be set up in the preferences, as it can be useful some times too.