canvas rotate
Turns the coordinates of the items around a point.
PATHNAME rotate TAGORID X Y ANGLE
Description
Turns the coordinates of each item of TAGORID by ANGLE degrees anticlockwise on the screen around the point X,Y, as in Tk 9. A line and a polygon turn each point. A rectangle, an oval, and an arc keep their shape: the center turns, and the corners move with it. A text, an image, a bitmap, and a window turn their one point; the -angle of a text stays.
Returns
An empty string.
Examples
% canvas .rt
> .rt create line 10 0 20 0
> .rt rotate 1 0 0 90
> lmap v [.rt coords 1] {expr {round($v)}}
0 -10 0 -20
# The rectangle keeps its shape and moves.
% canvas .rt2
> .rt2 create rectangle 10 -2 20 2
> .rt2 rotate 1 0 0 90
> lmap v [.rt2 coords 1] {expr {round($v)}}
-5 -17 5 -13
Errors
% canvas .rt3; .rt3 rotate
wrong # args: should be ".rt3 rotate tagOrId x y angle"
-errorcode NONE
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztk 1.0.0-beta.10