Tk::RotCanvas - Canvas widget with arbitrary rotation support
$canvas = $parent->RotCanvas(?options?); my $obj = $canvas->create('polygon', @coords, %options); $canvas->rotate($obj, $angle, ?x, y?);
This module is a small wrapper around the
Canvas widget that adds a new rotate() method. This method allows the rotation of various canvas objects by arbitrary angles.
As mentioned previously, there is only one new method. All other canvas methods work as expected.
This method rotates the object identified by TagOrID by an angle angle. The angle is specified in degrees. If a coordinate is specified, then the object is rotated about that point. Else, the object is rotated about its center of mass.
As it stands, the module can only handle the following object types:
All other object types (bitmap, image, arc, text and window) can not be handled yet. A warning is issued if the user tries to rotate one of these object types. Hopefully, more types will be handled in the future.
To be able to handle rectangles, the module intercepts any calls to createRectangle() and create() and changes all rectangles to polygons. The user should not be alarmed if type() returned polygon when a rectangle was expected.
Similarly, ovals are converted into polygons.
Special thanks go to Larry Shatzer for developing the code to handle ovals.
Ala Qumsieh email@example.com
This module is distributed under the same terms as Perl itself.