5

I have difficulties understanding the coordinate system for SVG shapes on my viewBox. In Inkscape i have set the page size to A4-Paper size (Width = 793.70079, Height = 1122.51969) and i have a rectangle with 100x100 side. When i move the rectangle in Inkscape upwards as you can see in the first picture below the y-coordinate is growing, while moving downwards decreases the Y value. This seems for me in contrary to the concept that upleft-corner is set to (0, 0) and Y increases towards the bottom of the page.

Rect towards topleft:

enter image description here

Rect towards bottomleft:

enter image description here

And more specifically the (0, 0) point of my viewBox seems to be the bottomleft corner rather than the topleft (which also seems to apply to my rectangle, so that setting it's (x, y) to (0, 0) puts it at the bottomleft corner). Can someone point me to what i am missing?

  • 1
    It is not the SVG coordinate system but it is PostScript coordinates. TBH it makes more sense that positive values are upward given that every math class, graph, technical drawing has it oriented that way. There is no way we need to change all our customs just because electron beams were drawn in this order (in fact we dont use displays like that anymore either) – joojaa Aug 25 at 9:30
4

It has nothing to do with the SVG format. It's just a little quirkiness of Inkscape's co-ordinate system. The page origin is at the bottom left, and the object origin is the same, which is as you say counter intuitive.

Not to worry though, you can find the real SVG co-ordinates in the XML editor. Just open it up using Shift+CTRL+X, and select the object, and you will see the real SVG co-ordinates. You can also set the real co-ordinates in the XML editor if required.

For example:

enter image description here

2

Using search terms "inkscape invert coordinates," I learned that this is an undesirable feature of inkscape to as far back as 0.48 and has been forecast to be corrected on v 0.49, but as of 0.92, there is nothing changed. I found references to patches which flip the Y axis but it was too obscure for my understanding.

Other posts on the 'net indicate that it's a low priority for those with the skills to create the patches, hence the interminable delay.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy