All Manuals > CAPI User Guide and Reference Manual > 22 GRAPHICS-PORTS Reference Entries

NextPrevUpTopContentsIndex

with-graphics-post-translation

Macro
Summary

Like with-graphics-translation except that the translation is done after applying all existing transforms.

Signature

with-graphics-post-translation ( port dx dy ) &body body => result

Arguments

port

A graphics port.

dx

A real number.

dy

A real number.

body

Lisp forms.

Values

result

The value returned by the last form of body .

Description

The macro with-graphics-post-translation is the same as with-graphics-translation, but the translation is done after applying all existing transforms. That means that the translation is "absolute", not transformed. In contrast, when using with-graphics-translation the translation is transformed by any existing transform(s).

Examples

This form draws a 40x40 rectangle at (100,100), because the scale is applied to the coordinates of the rectangle, but not to the translation.

(gp:with-graphics-scale (port
 2 2)
  (gp:with-graphics-post-translation (port
 100 100)
    (gp:draw-rectangle port
 0 0 20 20)))

Compare with this form, using with-graphics-translation instead, which draws a 40x40 rectangle at (200,200), because the scale applies to the translation too:

(gp:with-graphics-scale (port
 2 2)
  (gp:with-graphics-translation (port
 100 100)
    (gp:draw-rectangle port
 0 0 20 20)))
See also

with-graphics-transform-reset
with-graphics-translation
Setting the graphics state


CAPI User Guide and Reference Manual (Unix version) - 3 Aug 2017

NextPrevUpTopContentsIndex