moveMode

$canvaseditor moveMode mode
manages canvas bindings to move selected elements interactively

obj method canvaseditor moveMode {{mode both}} {
  set canvas [my canvas]
  $self selected dots storeXY
  $self selected calcCenter
  $self snapMode on
  set refDot [$self nearestDot -selected -end]
  set baseX [$refDot private baseX]
  set baseY [$refDot private baseY]
  #
  $self memory currentDot $refDot
  $self memory transformation "move $mode"
  #
  $self selected blink off
  $self memory before [$self undoRedoCode]
  #
  $self pointerToDot $refDot
  $self memory currentDot $refDot
  update
  $self basicBindings off
  $self statusLine Move objects $mode
  after idle [list bind $canvas <Motion> [subst -nocommand {
        $self moveSelection\
          [$self canvasx %x] [$self canvasy %y]\
          $baseX $baseY $mode
      }]]
  bind $canvas <<Click>> [list $self finishTransform]
  $canvas configure -cursor crosshair
}

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