shearHmode

$canvaseditor shearHmode mode
manages canvas bindings to interactive horizontal shearing of selection

obj method canvaseditor shearHmode {{mode parallel}} {
  set canvas [my canvas]
  $self selected dots storeXY
  $self selected calcCenter
  $self selected blink off
  $self snapMode on
  #
  set nDot [$self nearestDot -selected]
  $self pointerToDot $nDot
  $self memory currentDot $nDot
  $self memory transformation "shear horizontal $mode"
  #
  set UppY [[$self uppermostDot -gravity] cget -y]
  set BotY [[$self lowermostDot -gravity] cget -y]
  set MidY [expr {($UppY + $BotY) / 2}]
  if {[$nDot cget -y] < $MidY} then {
    set BaseY $BotY
  } else {
    set BaseY $UppY
  }
  #
  set x0 [$nDot cget -x]
  set y0 [$nDot cget -y]
  #
  $self memory before [$self undoRedoCode]
  #
  $self basicBindings off
  $self statusLine Shear objects horizontal $mode
  after idle [list bind $canvas <Motion> [subst -nocommand {
        $self shearHselection\
          [$self canvasx %x] [$self canvasy %y]\
          $x0 $y0 $BaseY $mode
      }]]
  bind $canvas <<Click>> "
    $self finishTransform
    "
}

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