class: ImageView
authorStefan Vogel <sv@exept.de>
Fri, 24 Apr 2015 14:10:43 +0200
changeset 4732 b5db158865ca
parent 4731 145b177a3203
child 4733 9ad52ca7b1c3
class: ImageView changed: #mouseWheelZoom: use integer zoom values if possible
ImageView.st
--- a/ImageView.st	Tue Apr 14 14:46:09 2015 +0200
+++ b/ImageView.st	Fri Apr 24 14:10:43 2015 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1993 by Claus Gittinger
 	      All Rights Reserved
@@ -11,6 +13,8 @@
 "
 "{ Package: 'stx:libwidg2' }"
 
+"{ NameSpace: Smalltalk }"
+
 View subclass:#ImageView
 	instanceVariableNames:'image magnifiedImage adjust magnificationFactor tileMode
 		tileOffset lastMousePoint'
@@ -639,7 +643,11 @@
         mul := 0.8.
     ].
 
-    magnificationFactor := (magnificationFactor ? 1) * mul.
+    magnificationFactor := ((magnificationFactor ? 1) * mul).
+    magnificationFactor fractionPart < 0.1 ifTrue:[
+        "magnifying by integer factor is faster"    
+        magnificationFactor := magnificationFactor truncated.
+    ].
     magnifiedImage := nil.
     self invalidate.
 
@@ -710,11 +718,11 @@
 !ImageView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/ImageView.st,v 1.82 2014-04-03 21:22:18 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/ImageView.st,v 1.83 2015-04-24 12:10:43 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg2/ImageView.st,v 1.82 2014-04-03 21:22:18 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/ImageView.st,v 1.83 2015-04-24 12:10:43 stefan Exp $'
 ! !