joinEnd

In some cases it is desirable that lines share dots physically, e.g. when collected to a fill object.

$line joinEnd $other
replaces physically ending dot with starting dot of $other
$line joinEnd $other first
replaces physically starting dot with ending dot of $other

obj method line joinEnd {other {end last}} {
  set dots [my dots]
  if {$end eq "last"} then {
    [$self lastDot] remove $self
    lset dots end [$other firstDot]
    my dots $dots
    [$self lastDot] add $self
  } else {
    [$self firstDot] remove $self
    lset dots 0 [$other lastDot]
    my dots $dots
    [$self firstDot] add $self
  }
}

© Wolf-Dieter Busch | Home | Sitemap | Urheber | A-Z