ObjectView.st
changeset 2736 76212cf614cc
parent 2730 61a2f1981ac6
child 2747 6fd2aa4c9300
--- a/ObjectView.st	Tue Apr 22 15:10:30 2003 +0200
+++ b/ObjectView.st	Wed Apr 23 16:20:00 2003 +0200
@@ -3193,8 +3193,8 @@
 !
 
 zoom:factor
-    "set a zoom factor; nil or 1 is identity; 2 is magnify by 2;
-     0.5 is shrink by 2"
+    "set a zoom factor; smaller than 1 is shrink; larger than 1 is magnify. 
+     I.e. 1 is identity; 2 is magnify by 2; 0.5 is shrink by 2"
 
     |current|
 
@@ -3229,18 +3229,22 @@
 !
 
 zoomIn
+    "zoom in - multiply the zoom factor by 1.5"
+
     self zoomIn:1.5
 
     "Modified: / 10.2.2000 / 21:14:41 / cg"
 !
 
 zoomIn:factor
+    "zoom in by multiplying the zoom factor by the argument"
+
     transformation isNil ifTrue:[
         transformation := WindowingTransformation scale:1 translation:0
     ].
     transformation := WindowingTransformation 
-                                scale:(transformation scale * factor)
-                                translation:(transformation translation * factor) rounded.
+                        scale:(transformation scale * factor)
+                        translation:(transformation translation * factor) rounded.
     self contentsChanged.
     self setInnerClip.
     self invalidate.
@@ -3250,21 +3254,17 @@
 !
 
 zoomOut
+    "zoom in - divide the zoom factor by 1.5"
+
     self zoomOut:1.5
 
     "Modified: / 10.2.2000 / 21:14:46 / cg"
 !
 
 zoomOut:factor
-    transformation isNil ifTrue:[
-        transformation := WindowingTransformation scale:1 translation:0
-    ].
-    transformation := WindowingTransformation 
-                        scale:(transformation scale / factor)
-                        translation:(transformation translation / factor) rounded.
-    self contentsChanged.
-    self setInnerClip.
-    self invalidate
+    "zoom out by dividing the zoom factor by the argument"
+
+    self zoomIn:(1.0 / factor)
 
     "Created: / 27.4.1996 / 10:09:19 / cg"
     "Modified: / 10.2.2000 / 21:10:52 / cg"
@@ -3273,5 +3273,5 @@
 !ObjectView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/ObjectView.st,v 1.95 2003-04-15 11:57:52 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/ObjectView.st,v 1.96 2003-04-23 14:20:00 cg Exp $'
 ! !