aboutsummaryrefslogtreecommitdiff
path: root/Perl
diff options
context:
space:
mode:
authormertz2004-05-26 20:32:45 +0000
committermertz2004-05-26 20:32:45 +0000
commit564b98cc44155f9b870124a6381bab3907497952 (patch)
tree4f7c3d429c5a37553f5e027eae394912447cc6c6 /Perl
parent4212d31cf1d60bc66919cfbd5ac7d5e8714fe56d (diff)
downloadtkzinc-564b98cc44155f9b870124a6381bab3907497952.zip
tkzinc-564b98cc44155f9b870124a6381bab3907497952.tar.gz
tkzinc-564b98cc44155f9b870124a6381bab3907497952.tar.bz2
tkzinc-564b98cc44155f9b870124a6381bab3907497952.tar.xz
adding 3 tests for field/label bbox (currently only empty
fields / labels are tested
Diffstat (limited to 'Perl')
-rw-r--r--Perl/t/Bbox.t42
1 files changed, 39 insertions, 3 deletions
diff --git a/Perl/t/Bbox.t b/Perl/t/Bbox.t
index 238da00..b6f5419 100644
--- a/Perl/t/Bbox.t
+++ b/Perl/t/Bbox.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
#
-# $Id: Bbox.t,v 1.2 2004-05-24 19:55:03 mertz Exp $
+# $Id: Bbox.t,v 1.3 2004-05-26 20:32:45 mertz Exp $
# Author: Christophe Mertz
#
@@ -9,7 +9,7 @@
BEGIN {
if (!eval q{
- use Test::More tests => 5;
+ use Test::More tests => 8;
1;
}) {
print "# tests only work properly with installed Test::More module\n";
@@ -66,7 +66,7 @@ ok(&similarFlatArray ([$zinc->bbox($txt1)],
"bbox of empty text");
my $width = $zinc->fontMeasure('font20pixels', 'dummy');
-print "width = $width\n";
+#print "width = $width\n";
my $txt2 = $zinc->add('text', 1,
-font => 'font20pixels',
-alignment => 'left',
@@ -110,6 +110,42 @@ ok(&similarFlatArray ([$zinc->bbox($txt4)],
"bbox of 'dummy' centered text");
+### testing bbox of fields or labels of track/waypoint and tabular items
+my $track = $zinc->add('track', 1, 4, -position => [56, 78]);
+print "bbox=(", join(',', $zinc->bbox(-label, $track)),")\n";
+is_deeply ([ $zinc->bbox(-label, $track) ],
+ [ ],
+ "bbox of a track label without labelformat");
+
+#print "bbox=(", join(',', $zinc->bbox(-field, 2, $track)),")\n";
+is_deeply ([ $zinc->bbox(-field, 2, $track) ],
+ [ ],
+ "bbox of a track field without labelformat");
+
+$zinc->itemconfigure($track, -labelformat => 'x20x18+0+0');
+#print "bbox=(", join(',', $zinc->bbox(-label, $track)),")\n";
+
+
+#print "bbox=(", join(',', $zinc->bbox(-field, 4, $track)),")\n";
+is_deeply ([ $zinc->bbox(-field, 4, $track) ],
+ [ ],
+ "bbox of a empty track field");
+
+
+# my $wpt = $zinc->add('waypoint', 1, 0, -position => [561, 781]);
+# is_deeply([ $zinc->coords($wpt) ],
+# [ 561,781 ],
+# "coords of a waypoint");
+# my $tab = $zinc->add('tabular', 1, 1, -position => [61, 81]);
+# is_deeply([ $zinc->coords($tab) ],
+# [ 61,81 ],
+# "coords of a empty tabular");
+# $zinc->itemconfigure($tab, -labelformat => 'x20x18+0+0');
+# is_deeply([ $zinc->coords($tab) ],
+# [ 61,81 ],
+# "coords of a tabular with a labelformat");
+
+
sub similarPoints {