Relative Content

Tag Archive for svg

Can I have calculated coordinates in an svg without additional javascript?

Is is possible in svg to define coordinates relative to the boundary that dont get scaled? In this example, I have a square with an additional path inside. The coordinates of the point should be (w-1, h-1), regardless of the scaling. So, if the box if (0,0),(10,10) it should b at (9,9) and if the coordinates would be (2,2),(20,20) it should be at(19,19).

Can I have calculated coordinates in an svg without additional javascript?

Is is possible in svg to define coordinates relative to the boundary that dont get scaled? In this example, I have a square with an additional path inside. The coordinates of the point should be (w-1, h-1), regardless of the scaling. So, if the box if (0,0),(10,10) it should b at (9,9) and if the coordinates would be (2,2),(20,20) it should be at(19,19).

Formal limits or baseline of decimal precision in SVG implementations

I have tested some very basic SVG sample (stroked circle filling square viewport with dash-array producing quarter slices) in varying viewBox dimensions, and observed some spectacular rendering and behavioural discrepancies across implementations, which — while somewhat expected along the lines of thought that ‘there will inevitably be some floating point precision loss involved somewhere’ — happened surprisingly early, either in rendering or in calculated “interactive hit-box” of the rendered shape.

SVG circle stroke small radius

I create a svg library for my software using only svg outline and no fill. That way I can easily adjust appearance and color.