[Kde-games-devel] Anyone can help with manipulating an SVG file?

Ian Wadham iandw.au at gmail.com
Sun Jan 5 04:51:01 UTC 2014


On 05/01/2014, at 12:15 AM, Alexander Schuch wrote:
> I added a patch for Konquest to vertically align wide boards. The
> board uses an SVG element as background and it did not align properly,
> so I dug into it. The problem is that the element's size does not
> match its content at the upper edge, as it has some completely
> transparent bar at the top.
> 
> Anyone can resize the element so that the bar is gone?
> 
> What to do/what I managed to do:
> 
> 1) Download the file from git:
> http://quickgit.kde.org/?p=konquest.git&a=blob&h=887203358bdeedc1decfedfa80cc1f474d2929d4&f=pics%2Fdefault_theme.svgz&o=plain
> 
> 2) Rename the file to "default_theme.svg.gz".
> 
> 3) Uncompress it using "gzip -d default_theme.svg.gz".
> 
> 4) Open the file in Inkscape.

The file can be opened direct in Inkscape.  *.svgz is an Inkscape
format, as used by our artists a few years ago.

> 5) Use Ctrl+F to open a search dialogue. Enter "screen" as "ID".
> 
> 6) A rectangular selection box is shown. The content is something
> greyish with a white "bar" at the upper edge inside the selection.
> 
> My guess right now is that this element is expanded by 5 pixels and
> moved 5 pixels up so that this bar is not shown, see
> https://git.reviewboard.kde.org/r/114851/diff/#2.10.

In Inkscape, you can scroll down to find the foggy grey rectangle and
click on it.  Use menu item Object->Object Properties to confirm that
it is called "screen".

> So if someone can help to remove that bar, I appreciate it.

Here my Inkscape skills run out. The "screen" object is a "group",
probably bounded by a transparent rectangle (which is hard to
select, but useful for handling pixmaps programmatically).  I can
Object->Ungroup "screen" and move bits and pieces around, then
re-Group and rename as "screen".  Not sure if that is correct.

> For testing, the -5 and +5 offsets just need to be removed. If the
> transparent/greyish background still covers the top, it works
> perfectly. This can be checked easily by having planets in the first
> row.

I downloaded your patch and tried taking out the -5 and +5. It was hard
to see the problem.  I had to set up a magnifying glass … ;-)  Are you
being a teensy bit fussy?  BTW it is there in the horizontally stretched
view, just harder to see because of the very dark area above it.

> The fixed SVG then can either be attached to my review request, or
> directly committed to git master - it won't break anything and just
> the first few lines of the greyish background won't be shown as long
> as the hack is still present.

I "fixed" the SVG, but strangely the new file is only about 1/10th the size
of the old.  This could be due to accidental deletions by me or maybe
more efficient use of SVG and compression by Inkscape.  I can email
you the file personally if you wish to try it out --- or it might be safest to
just leave in the -5/+5 hack.

Cheers, Ian W.




More information about the kde-games-devel mailing list