| 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 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 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 | 0 | ▶ | { | ||||||||
|
Subroutine
Draw: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 33 | 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}); | |||||||||
| 39 | |||||||||||
| 40 | 0 | for my $stuff (@{$new_parents}) | |||||||||
| 41 | { | ||||||||||
| 42 | 0 | ▶ | if (defined $File::Atomism::EVENT->{_new}->{$stuff}) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 43 | { | ||||||||||
| 44 | $canvas->createLine ($self->{0}->[0] + $offset->[0] ."m", | ||||||||||
| 45 | $self->{0}->[1] + $offset->[1] ."m", | ||||||||||
| 46 | $self->{1}->[0] + $offset->[0] ."m", | ||||||||||
| 47 | 0 | $self->{1}->[1] + $offset->[1] ."m", | |||||||||
| 48 | -tags => $tags); | ||||||||||
| 49 | } | ||||||||||
| 50 | } | ||||||||||
| 51 | } | ||||||||||
| 52 | |||||||||||
| 53 | 1 | 1; | |||||||||