Code

Merge and cleanup of GSoC C++-ification project.
[inkscape.git] / doc / coordinates.txt
1 Please note that the behavior documented here (from Sodipodi) should be considered a bug.
3 Inkscape should switch to the native SVG coordinate system.
5 -mental
7 Coordinate systems used by sodipodi
9 1. Desktop coordinates
11 Are the base coordinate system of all editing, UI etc.
12 i.e. the ones user is directly seeing (maybe some time
13 we'll make this configurable).
15 0,0 is at lower-left
16 X grows to the right
17 Y grows upwards
18 Only valid units are real-world ones (mm, cm...) - i.e.
19 there is no such unit as pixel etc.
20 If printed, 1 desktop mm should be 1mm on paper
22 2. Document coordinates
24 As we all know, SVG Y grows downwards. So document is
25 placed at 0,HEIGHT, mirrored vertically, where HEIGHT
26 is vieport height in desktop coordinates.
27 Moreover SVG coordinate space is scaled by 0.8, so
28 1mm in SVG space equals 1mm in desktop space.
30 The full matrix looks like:
32 [ 0.8  0.0  0.0    ]
33 [ 0.0 -0.8  HEIGHT ]
35 Where height equals SVG viewport height in real units
36 i.e. if viewport is 210mmx297mm HEIGHT is also 297mm.
38 Document coordinates are stored in desktop object,
39 as doc2dt[] matrix, and not directly accessible to
40 document itself. I.e. document renders it just as any
41 normal SVG viewer should do.
43 Technically SVG placement is achieved by specifying
44 doc2dt transform to drawing parent canvas group.
46 3. user coordinates
48 These are as specified by SVG spec.
49 1 px == 1 user unit
50 1 pt == 1.25 px
51 etc.
53 31/08/2002 Lauris Kaplinski <lauris@kaplinski.com>