rotateSelectionNumeric

$canvaseditor rotateSelectionNumeric phi
rotates selected elements by $phi degrees

obj method canvaseditor rotateSelectionNumeric phi {
  set min [min {*}[$self dots -selected -gravity cget -x]]
  set max [max {*}[$self dots -selected -gravity cget -x]]
  set xC [expr {($min + $max) / 2.0}]
  set min [min {*}[$self dots -selected -gravity cget -y]]
  set max [max {*}[$self dots -selected -gravity cget -y]]
  set yC [expr {($min + $max) / 2.0}]
  set arc [expr {2 * 3.141592653589793 / 360 * $phi}]
  $self dots -selected storeXY
  $self selected rotateObjNumeric $arc $xC $yC
}

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