ImageView.st
changeset 5507 a5c432b78ff6
parent 5503 5cbf5c6569c4
child 5529 4eee15e7acbe
--- a/ImageView.st	Sun Feb 26 18:17:45 2017 +0100
+++ b/ImageView.st	Mon Feb 27 23:41:56 2017 +0100
@@ -843,7 +843,21 @@
 
     mag := self magnification.
     pos := aPoint * mag.
-    self scrollTo:(pos - (self extent / 2)) rounded.
+    (self bounds containsPoint:aPoint) ifFalse:[
+        pos := (pos min:(image extent - self extent)) max:0@0.
+        self scrollTo:(pos - (self extent / 2)) rounded.
+    ].
+
+    "
+     |v|
+     v := ImageView new image:(Image fromFile:'../../goodies/bitmaps/gifImages/garfield.gif').
+     v openAndWait.
+     v inspect.
+     v scrollToMakeVisible:(300@100).
+    "
+
+    "Modified: / 27-02-2017 / 16:05:49 / cg"
+    "Modified (comment): / 27-02-2017 / 23:41:45 / cg"
 ! !
 
 !ImageView class methodsFor:'documentation'!