*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Wed, 27 May 2009 15:50:24 +0200
changeset 3705 a75510393dc8
parent 3704 c9b2102bfd1c
child 3706 e95e7f0e4f82
*** empty log message ***
ImageView.st
--- a/ImageView.st	Wed May 27 08:05:59 2009 +0200
+++ b/ImageView.st	Wed May 27 15:50:24 2009 +0200
@@ -261,6 +261,12 @@
     self setImage:anImage scroll:doScroll
 !
 
+image:anImage scroll:doScroll invalidate:doInvalidate
+    "set the image - show a wait cursor, since image dithering may take a while"
+
+    self setImage:anImage scroll:doScroll invalidate:doInvalidate
+!
+
 magnification
     magnifiedImage isNil ifTrue:[^ 1@1].
     ^ magnifiedImage extent / image extent
@@ -302,6 +308,12 @@
 setImage:anImage scroll:doScroll
     "set the image - show a wait cursor, since image dithering may take a while"
 
+    self setImage:anImage scroll:doScroll invalidate:false "true"
+!
+
+setImage:anImage scroll:doScroll invalidate:doInvalidate
+    "set the image - show a wait cursor, since image dithering may take a while"
+
     |oldSize newSize|
 
     oldSize := image ifNil:[0@0] ifNotNil:[image extent].
@@ -312,22 +324,22 @@
 
     newSize := image ifNil:[0@0] ifNotNil:[(magnifiedImage ? image) extent].
     doScroll ifTrue:[
-	self scrollToTopLeft.
+        self scrollToTopLeft.
     ].
 
     oldSize ~= newSize ifTrue:[
-	"/ avoid endless loop in case of a resize happening due
-	"/ to scrollBar visibility changes.
-	"/ that QuerySignal suppresses another magnification in sizeChanged: 
-	DoNotMagnifyQuery answer:true
-	do:[
-	    self contentsChanged.
-	]
+        "/ avoid endless loop in case of a resize happening due
+        "/ to scrollBar visibility changes.
+        "/ that QuerySignal suppresses another magnification in sizeChanged: 
+        DoNotMagnifyQuery answer:true
+        do:[
+            self contentsChanged.
+        ]
     ].
 
-    shown ifTrue:[
-	self clear.
-	self invalidate
+    (shown and:[doInvalidate]) ifTrue:[
+        self clear.
+        self invalidate
     ].
     self changed:#image.
 
@@ -580,13 +592,13 @@
 
     mag := self magnification.
     pos := aPoint * mag.
-    self scrollTo:(pos - (self extent / 2)).
+    self scrollTo:(pos - (self extent / 2)) rounded.
 ! !
 
 !ImageView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/ImageView.st,v 1.67 2009-05-04 13:24:09 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/ImageView.st,v 1.68 2009-05-27 13:50:24 cg Exp $'
 ! !
 
 ImageView initialize!