diff options
Diffstat (limited to 'demos/tiger.tcl')
-rw-r--r-- | demos/tiger.tcl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/demos/tiger.tcl b/demos/tiger.tcl index b0ac265..c494c7b 100644 --- a/demos/tiger.tcl +++ b/demos/tiger.tcl @@ -534,6 +534,8 @@ bind $w.zinc <ButtonPress-1> "press motion %x %y" bind $w.zinc <ButtonRelease-1> release bind $w.zinc <ButtonPress-2> "press zoom %x %y" bind $w.zinc <ButtonRelease-2> release +bind $w.zinc <ButtonPress-3> "press mouseRotate %x %y" +bind $w.zinc <ButtonRelease-3> release set curX 0 @@ -577,7 +579,6 @@ proc zoom {x y} { } set sx [expr 1.0 + (double($x - $curX) / $maxX)] set sy [expr 1.0 + (double($y - $curY) / $maxY)] - puts "x: $x cur: $curX max: $maxX $sx" $w.zinc scale $topGroup $sx $sx set curX $x set curY $y @@ -587,7 +588,7 @@ proc mouseRotate {x y} { global w curAngle topGroup set lAngle [expr atan2($y, $x)] - $w.zinc rotate $topGroup [expr -($lAngle - $curAngle)] + $w.zinc rotate $topGroup [expr $lAngle - $curAngle] set curAngle $lAngle } |