Re: [Inkscape-devel] [Inkscape-user] Losing colours when copying
On 11/10/2007, at 10:22 AM, greg fenton wrote:
I am using some images from openclipart.
I am trying to copy two different balloons (clipart/recreation/ party/balloon-red-aj.svg and balloon-blue-aj.svg) into a single new image.
I first copy -red and paste into the new image and all is good. When I copy -blue and paste into the new image, it is pasted also as red (not blue). Nothing I seem to do will copy the image over as blue.
If I create a second new image and paste just the blue, it copies over as blue. If I then copy red and paste, it pastes as blue.
Any suggestions as to how I can get the copy to happen?
Just a guess...
I had an SVG file where some of the colour were defined using CSS as a top-level style tag. When they were opened in Inkscape they displayed fine, but those colour came out wrong when copied to a new file since I guess the CSS values were not copied across.
I was able to paste it to the other file with correct colours by: 1) Open the file in Inkscape 2) Select the relevant objects and copy 3) Paste them within the same document 4) Copy the newly pasted selection 5) Paste that into the new document
These steps don't work with you balloon example. Your problem looks similar but with gradients instead of CSS, probably because the gradients are named the same in different coloured balloon images, so the pasted blue balloon just references the red balloons gradients in the pasted version since they are named the same.
I'm not sure if this should be considered a bug or not (multiple pasted balloons use the same gradients). CC'ing to the developers list to see what people think about this, and whether there is any kind of hidden option to get the behaviour you want.
Cheers, Michael
On Thursday, October 11, 2007, 3:33:30 AM, Michael wrote:
MW> I had an SVG file where some of the colour were defined using CSS MW> as a top-level style tag. When they were opened in Inkscape they MW> displayed fine, but those colour came out wrong when copied to a MW> new file since I guess the CSS values were not copied across.
Or because the styles are mixed together.
I suspect the two balloon cliparts are the same structure with different styling. (This is another area where presentation attributes give you a benefit, since that mixing will not hapen).
MW> I was able to paste it to the other file with correct colours by: MW> 1) Open the file in Inkscape MW> 2) Select the relevant objects and copy MW> 3) Paste them within the same document MW> 4) Copy the newly pasted selection MW> 5) Paste that into the new document
MW> These steps don't work with you balloon example. Your problem MW> looks similar but with gradients instead of CSS,
Gradients us a styling property, in SVG. So its quite likely to be the same thing. Or conflicting ids (two gradients, with different colors, with the same id).
MW> probably because MW> the gradients are named the same in different coloured balloon MW> images, so the pasted blue balloon just references the red MW> balloons gradients in the pasted version since they are named the same.
Yes I think thats the case here. In which case it can be fixed up in a text editor using search and replace.
MW> I'm not sure if this should be considered a bug or not (multiple MW> pasted balloons use the same gradients). MW> CC'ing to the developers list to see what people think about MW> this, and whether there is any kind of hidden option to get the behaviour you want.
Not detecting duplicate ids could be considered a bug. Of course by the time the second balloon is pasted in, its too late to disambiguate the references. However, detecting a potential id conflict between the current document and the copy/paste buffer when paste is selected (and warning, offering to fix up the conflicts before pasting) would be a nice feature.
On 10/11/07, Chris Lilley <chris@...157...> wrote:
Not detecting duplicate ids could be considered a bug.
And it is in fact one of the oldest bugs in our tracker. Mental has some grand plan for fixing it, which is one reason why I haven't yet tried a simpler hack :)
On Thu, 11 Oct 2007 11:31:47 +0200, Chris Lilley <chris@...157...> wrote:
However, detecting a potential id conflict between the current document and the copy/paste buffer when paste is selected (and warning, offering to fix up the conflicts before pasting) would be a nice feature.
Yes; unfortunately the existing copy/paste implementation just blindly mashes an XML fragment into the target document. ID conflicts are detected and resolved by the target document, but at that point it is too late to update references to conflicting objects.
The copy/paste code needs to be rewritten to work at the SVG object model level (SPObject) rather than at the XML level, so that the required knowledge to update all the various reference attributes and properties is available, and can be done in advance. That's basically the "grand plan" bulia was alluding to.
(It would be nice if the copy/paste stuff integrated with the system clipboard as well.)
-mental
I've got revision 16207 which appears to work fine except for filter effects, which don't work at all. The dialog is all there, it just doesn't do anything when I add an effect and change a value.
The strange thing is that, when I add a gaussian blur from the fill/stroke dialog, it does appear in the filter list, and I can change the value from the filter effects dialog, and it appears to work as it should. But I still can't add a gaussian blur from the filter effects dialog directly and edit it.
This has happened with several recent builds. I've not gotten one that works yet. Am I missing a newly required lib or something?
Thanks.
JF
On Fri, 2007-10-12 at 23:43 -0500, Joshua Facemyer / Impressus Art wrote:
I've got revision 16207 which appears to work fine except for filter effects, which don't work at all. The dialog is all there, it just doesn't do anything when I add an effect and change a value.
The strange thing is that, when I add a gaussian blur from the fill/stroke dialog, it does appear in the filter list, and I can change the value from the filter effects dialog, and it appears to work as it should. But I still can't add a gaussian blur from the filter effects dialog directly and edit it.
This has happened with several recent builds. I've not gotten one that works yet. Am I missing a newly required lib or something?
I had the same problem... until I realized that after you add a new filter you must, with the object selected, double-click on the filter name to apply it. In the latest build, this has changed to checking the box next to the filter name (a great improvement!).
Tav
participants (6)
-
bulia byak
-
Chris Lilley
-
Joshua Facemyer / Impressus Art
-
MenTaLguY
-
Michael Wybrow
-
Tavmjong Bah