Combines a transformation (rotation, scaling or translation) with the transform of a port for the duration of the macro.
graphics-ports
with-graphics-rotation (port angle) &body body => result
with-graphics-scale (port sx sy) &body body => result
with-graphics-translation (port dx dy) &body body => result
port⇩ |
A graphics port. |
angle⇩ |
A real number. |
body⇩ |
A body of Lisp code. |
Real numbers. | |
Real numbers. |
result |
The return value(s) of the last form executed in body. |
The macros with-graphics-rotation
, with-graphics-scale
and with-graphics-translation
combine the transform associated with port with an additional transform while evaluated the forms in body as an implicit progn. port is given a new transform obtained by pre-multiplying its current transform with the transform that the macro creates.
with-graphics-rotation
creates a transformation that rotates by angle radians. If angle is positive, then the rotation is clockwise.
with-graphics-scale
creates a transformation that scales by sx and sy in the X and Y dimensions.
with-graphics-translation
creates a transformation that translates by dx and dy in the X and Y dimensions.
(example-edit-file "capi/graphics/catherine-wheel")
graphics-state
with-graphics-post-translation
with-graphics-transform
13.6 Graphics state transforms
13.3.1 Setting the graphics state
CAPI User Guide and Reference Manual (Macintosh version) - 01 Dec 2021 19:31:44