cancel
Showing results for 
Search instead for 
Did you mean: 

how to edit a stencilset sgv?

m2spring
Champ in-the-making
Champ in-the-making
Tried to create a new view SVG by opening activity/scripttask.svg in Inkscape, modifying it graphically and saving it.
Modeler does not really display what I expect.
What's the trick?
Thanks!
-Max
7 REPLIES 7

frederikherema1
Star Contributor
Star Contributor
Not really sure what you mean with "really display what I expect"? Inkscape has an "inkscape" SVG-format and can also save to plain-svg format, make sure you select the right one.

m2spring
Champ in-the-making
Champ in-the-making
Saving in plain SVG format does indeed help somewhat.

However, when I save it in plain format the gradient of the background box disappears and instead it's all black.
OK, I can fix that.

But what's really strange:
* the resulting task has a larger bounding box in Modeler
* when I resize the task box in Modeler my Jenkins image gets completely screwed up
[img]http://springdot.org/files/20130111-105553.png[/img]

The Jenkins image is its own group in the SVG.

-Max

trademak
Star Contributor
Star Contributor
Hi Max,

It's heard to say without trying your example myself.
When you convert the image to SVG then it should be possible to do what you want, because that's also how the user task icon is implemented.

Best regards,

m2spring
Champ in-the-making
Champ in-the-making
Hi Tijs,

I figured out a solution: After I added this to each path element, the logo stays intact, even when the box gets resized:
oryx:anchors="top left"
However, the bounding box is still being calculated wrongly:
[img]http://dl.dropbox.com/u/1917727/20130128-123849.png[/img]

I tried various modifications in the SVG XML code, but I couldn't figure out which causes it.

I just commited the new SVG.
https://github.com/m2spring/Activiti/commit/0595c16c62b28228009535b79a99173d1c98edc1
Can you please give it a try?

-Max

trademak
Star Contributor
Star Contributor
Hi Max,

I gave your SVG from Github a try. What seems to be wrong is the size of the Jenkins logo.
You have defined a translate="matrix…. line in the SVG and that seems to cause the issue. When I remove that line and drag a task to the canvas I get a very big Jenkins icon instead of a small one at the top left of the rectangle. And that icon is exactly as big as the border line you get when you include the translate="matrix… line.
It should be possible to immediately draw the icon in the right size without needing the translate="matrix… line.
And that should solve your issue with the wrong border line.

Best regards,

frederikherema1
Star Contributor
Star Contributor
Yes, SVG sometimes takes the original bounds of a image/geom BEFORE transformation to compute actual boundary size…

m2spring
Champ in-the-making
Champ in-the-making
Hi Tijs,

of course, I didn't "draw" the logo myself by hand 😉
I took the original artwork (Jenkins project has it in SVG format [1]) and scaled&translated it to fit the desired size&place.

Fortunately, after fiddling more with Inkscape (ungrouping/regrouping) and saving it again, Inkscape somehow executed the transform.
Now the <g> element no longer has a transform attribute and the resulting bounding box looks correct 🙂

Just FYI: I had to manually copy/paste the <g> element into the jenkinstask.svg file.
I have been unable to get Inkscape-saved files work in Modeler, even saved as plain SVG.
Anyhow, manually working in the SVG XML file isn't a big problem.

If you can find a solution to the bpmndi:BPMNEdge problem I reported in the other thread, then we might have something working.

Regards,
-Max

[1] https://wiki.jenkins-ci.org/display/JENKINS/Logo