Skip to content

Translate

Christopher Ross-Gill edited this page Aug 1, 2016 · 1 revision

TRANSLATE

Sets the origin for drawing commands.

Arg Type Description Values
offset [pair!]


Notes and Examples

Multiple translate commands will have a cumulative effect:

fill-pen blue box 50x50 150x150 translate 50x50 fill-pen red box 50x50 150x150 translate 50x50 fill-pen yellow box 50x50 150x150


You can use RESET-MATRIX to avoid that if you want:

fill-pen blue box 50x50 150x150 translate 50x50 fill-pen red box 50x50 150x150 reset-matrix translate 50x50 fill-pen yellow box 100x100 300x300


Another way to reset the matrix is to use the PUSH command:

fill-pen blue box 50x50 150x150 push [translate] translate 50x50 fill-pen yellow box 100x100 300x300


See also: http://www.w3.org/TR/SVG/coords.html#EstablishingANewUserSpace


Pages

Chapters
Clone this wiki locally