moveObj

$line moveObj x y baseX baseY mode draw
moves object interactively

obj method line moveObj {x y baseX baseY {mode both} {draw yes}} {
  set dx [- $x $baseX]
  set dy [- $y $baseY]
  if {$mode eq "horizontal"} then {
    lappend transformL moveHorizontal $dx
  } elseif {$mode eq "vertical"} then {
    lappend transformL moveVertical $dy
  } else {
    lappend transformL moveHorizontal $dx moveVertical $dy
  }
  $self dots transform {*}$transformL
  if {$draw} then {
    $self dots lines draw coords
  }
}

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