class: ImageView
changed: #mouseWheelZoom:
use integer zoom values if possible
--- 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 $'
! !