makeFullyVisible (fixed ?)
authorClaus Gittinger <cg@exept.de>
Wed, 15 Nov 1995 13:54:18 +0100
changeset 226 a953669c1ffe
parent 225 de92f38623f6
child 227 df0916a17ea2
makeFullyVisible (fixed ?)
SimpleView.st
--- a/SimpleView.st	Wed Nov 15 13:52:42 1995 +0100
+++ b/SimpleView.st	Wed Nov 15 13:54:18 1995 +0100
@@ -57,7 +57,7 @@
 !
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.26 1995-11-14 18:14:06 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.27 1995-11-15 12:54:18 cg Exp $'
 !
 
 documentation
@@ -2790,18 +2790,29 @@
      into the visible screen area if nescessary.
      This method will be moved to StandardSystemView ..."
 
-    ((top + height) > (device height)) ifTrue:[
-	self top:(device height - height)
-    ].
-    ((left + width) > (device width)) ifTrue:[
-	self left:(device width - width)
+    |right bot devBot devRight newTop newLeft|
+
+    right := left + width.
+    bot := top + height.
+
+    newTop := top.
+    newLeft := left.
+
+    ((left + width) > (devBot := device height)) ifTrue:[
+	newTop := devBot - height
     ].
-    (top < 0) ifTrue:[
-	self top:0
+    (right > (devRight := device width)) ifTrue:[
+	newLeft := devRight - width
+    ].
+    (newTop < 0) ifTrue:[
+	newTop := 0.
     ].
-    (left < 0) ifTrue:[
-	self left:0
+    (newLeft < 0) ifTrue:[
+	newLeft := 0
     ].
+    ((newTop ~~ top) or:[newLeft ~~ left]) ifTrue:[
+	self origin:newLeft @ newTop
+    ]
 !
 
 width:aNumber