line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Draft::TkGui::Entity::Line; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Draft::TkGui::Entity::Line - a line |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 SYNOPSIS |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
A line consists of two points. |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=cut |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
14
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
247
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# FIXME should subclass Draft::Entity::Line, not the other way around |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
#use Draft::Entity::Line; |
19
|
|
|
|
|
|
|
#use vars qw(@ISA); |
20
|
|
|
|
|
|
|
#@ISA = qw(Draft::Entity::Line); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=pod |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 DESCRIPTION |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Though a line consists of just two points, it should really be |
27
|
|
|
|
|
|
|
extended to an arbitrary number of points - A polyline. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub Draw |
32
|
|
|
|
|
|
|
{ |
33
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
34
|
0
|
|
|
|
|
|
my ($canvas, $offset, $parents, $ignore) = @_; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
my $new_parents = [@$parents, $self->{_path}]; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
my $tags = join (" ", @{$new_parents}); |
|
0
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
for my $stuff (@{$new_parents}) |
|
0
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
{ |
42
|
0
|
0
|
|
|
|
|
if (defined $File::Atomism::EVENT->{_new}->{$stuff}) |
43
|
|
|
|
|
|
|
{ |
44
|
0
|
|
|
|
|
|
$canvas->createLine ($self->{0}->[0] + $offset->[0] ."m", |
45
|
|
|
|
|
|
|
$self->{0}->[1] + $offset->[1] ."m", |
46
|
|
|
|
|
|
|
$self->{1}->[0] + $offset->[0] ."m", |
47
|
|
|
|
|
|
|
$self->{1}->[1] + $offset->[1] ."m", |
48
|
|
|
|
|
|
|
-tags => $tags); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |