aboutsummaryrefslogtreecommitdiff
path: root/Perl
diff options
context:
space:
mode:
authormertz2003-12-11 12:11:41 +0000
committermertz2003-12-11 12:11:41 +0000
commit6dc5261fe4bc3913aa3a849d49bf78ab8b2b5523 (patch)
treeb4c18594e9851dd61062965f947dbb71e79e7d7d /Perl
parent81131ebd8e0322edeb167164d95ae75fe5f2416c (diff)
downloadtkzinc-6dc5261fe4bc3913aa3a849d49bf78ab8b2b5523.zip
tkzinc-6dc5261fe4bc3913aa3a849d49bf78ab8b2b5523.tar.gz
tkzinc-6dc5261fe4bc3913aa3a849d49bf78ab8b2b5523.tar.bz2
tkzinc-6dc5261fe4bc3913aa3a849d49bf78ab8b2b5523.tar.xz
- adding some test for tset, treset, skew methods and 'device' transfo name
Diffstat (limited to 'Perl')
-rw-r--r--Perl/t/Transformations.t50
1 files changed, 48 insertions, 2 deletions
diff --git a/Perl/t/Transformations.t b/Perl/t/Transformations.t
index 8a86d8a..8d73060 100644
--- a/Perl/t/Transformations.t
+++ b/Perl/t/Transformations.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
#
-# $Id: Transformations.t,v 1.1 2003-10-02 09:14:23 mertz Exp $
+# $Id: Transformations.t,v 1.2 2003-12-11 12:11:41 mertz Exp $
# Author: Christophe Mertz
#
@@ -89,8 +89,54 @@ is_deeply([
$zinc->transform($rect2, 1, [$zinc->coords($rect2)] )
],
[ [20,20], [80, 80] ],
- "transform rect2 coordinates to window coordinates");
+ "transform rect2 coordinates to window coordinates, with group 1");
+is_deeply([
+ $zinc->transform($rect2, 'device', [$zinc->coords($rect2)] )
+ ],
+ [ [20,20], [80, 80] ],
+ "transform rect2 coordinates to window coordinates with 'device'");
+
+$zinc->scale(1, 0.5, 0.5);
+
+is_deeply([
+ $zinc->transform($rect2, 'device', [$zinc->coords($rect2)] )
+ ],
+ [ [10,10], [40, 40] ],
+ "transform rect2 coordinates to window coordinates with 'device'");
+
+# setting the top group transformation to the id, with a translation with tset
+$zinc->tset(1, 1,0, 0,1, -20,-10);
+is_deeply([
+ $zinc->transform($rect2, 'device', [$zinc->coords($rect2)] )
+ ],
+ [ [0,10], [60, 70] ],
+ "rect2 window coordinates with 'device' after topgroup transfo setting");
+
+# restting top group transformation
+$zinc->treset(1);
+is_deeply([
+ $zinc->transform($rect2, 'device', [$zinc->coords($rect2)] )
+ ],
+ [ [20,20], [80, 80] ],
+ "rect2 window coordinates with 'device' after topgroup treset");
+
+# resetting the rect2 trasnformation
+$zinc->treset($rect2);
+is_deeply([
+ $zinc->transform($rect2, 'device', [$zinc->coords($rect2)] )
+ ],
+ [ [10,10], [40, 40] ],
+ "rect2 window coordinates with 'device' after rect2 treset");
+$zinc->skew($rect2, 10,00);
+$zinc->skew($rect2, -10,00);
+is_deeply([
+ $zinc->transform($rect2, 'device', [$zinc->coords($rect2)] )
+ ],
+ [ [10,10], [40, 40] ],
+ "rect2 window coordinates with 'device' after rect2 skew (back and forth)");
diag("############## transformations test");
+
+