View.st
changeset 107 ef48048a8b34
parent 98 cd6af625d477
child 108 350822e42e34
--- a/View.st	Sat Feb 18 22:04:36 1995 +0100
+++ b/View.st	Wed Feb 22 02:19:35 1995 +0100
@@ -45,7 +45,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libview/View.st,v 1.28 1995-02-16 03:06:50 claus Exp $
+$Header: /cvs/stx/stx/libview/View.st,v 1.29 1995-02-22 01:19:20 claus Exp $
 '!
 
 "this flag controls (globally) how views look - it will vanish"
@@ -70,7 +70,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview/View.st,v 1.28 1995-02-16 03:06:50 claus Exp $
+$Header: /cvs/stx/stx/libview/View.st,v 1.29 1995-02-22 01:19:20 claus Exp $
 "
 !
 
@@ -2017,7 +2017,9 @@
      h     "{ Class:SmallInteger }"
      hCont 
      ih    "{ Class:SmallInteger }"
-     orgX orgY|
+     orgX  
+     orgY  "{ Class:SmallInteger }"
+     newOrigin|
 
     hCont := self heightOfContents.
     transformation isNil ifTrue:[
@@ -2037,27 +2039,32 @@
     (count <= 0) ifTrue:[^ self].
 
     self originWillChange.
-    self setViewOrigin:(orgX @ (orgY + count)).
-
-    m2 := margin * 2.
-    (count >= ih) ifTrue:[
-	self redrawDeviceX:margin y:margin
-		     width:(width - m2)
-		    height:(height - m2).
-    ] ifFalse:[
-	h := height - m2 - count.
-	w := self width.
-	self catchExpose.
-	self copyFrom:self x:margin y:(count + margin)
-			 toX:margin y:margin
-		       width:w 
-		      height:h.
-
-	self setInnerClip.
-	self redrawDeviceX:margin y:(h + margin) 
-		     width:(width - m2) height:count.
-
-	self waitForExpose.
+    newOrigin := orgX @ (orgY + count).
+    shown ifFalse:[
+	self setViewOrigin:newOrigin.
+    ] ifTrue:[
+	m2 := margin * 2.
+	(count >= ih) ifTrue:[
+	    self setViewOrigin:newOrigin.
+	    self redrawDeviceX:margin y:margin
+			 width:(width - m2)
+			height:(height - m2).
+	] ifFalse:[
+	    h := height - m2 - count.
+	    w := self width.
+	    self catchExpose.
+	    self setViewOrigin:newOrigin.
+	    self copyFrom:self x:margin y:(count + margin)
+			     toX:margin y:margin
+			   width:w 
+			  height:h.
+
+	    self setInnerClip.
+	    self redrawDeviceX:margin y:(h + margin) 
+			 width:(width - m2) height:count.
+
+	    self waitForExpose.
+	]
     ].
     self originChanged:(0 @ count).
 !
@@ -2070,7 +2077,8 @@
      w     "{ Class:SmallInteger }"
      h     "{ Class:SmallInteger }"
      orgX
-     orgY  "{ Class:SmallInteger }"|
+     orgY  "{ Class:SmallInteger }"
+     newOrigin|
 
     transformation isNil ifTrue:[
 	orgY := orgX := 0
@@ -2086,27 +2094,33 @@
     (count <= 0) ifTrue:[^ self].
 
     self originWillChange.
-    self setViewOrigin:(orgX @ (orgY - count)).
-
-    m2 := margin * 2. "top & bottom margins"
-    (count >= self innerHeight) ifTrue:[
-	self redrawDeviceX:margin y:margin
-		     width:(width - m2)
-		    height:(height - m2).
-    ] ifFalse:[
-	h := height - m2 - count.
-	w := width.
-	self catchExpose.
-	self copyFrom:self x:margin y:margin
-			 toX:margin y:(count + margin)
-		       width:w height:h.
-
-	self setInnerClip.
-	self redrawDeviceX:margin y:margin
-		     width:(width - m2)
-		    height:count.
-
-	self waitForExpose.
+    newOrigin := orgX @ (orgY - count).
+
+    shown ifFalse:[
+	self setViewOrigin:newOrigin.
+    ] ifTrue:[
+	m2 := margin * 2. "top & bottom margins"
+	(count >= self innerHeight) ifTrue:[
+	    self setViewOrigin:newOrigin.
+	    self redrawDeviceX:margin y:margin
+			 width:(width - m2)
+			height:(height - m2).
+	] ifFalse:[
+	    h := height - m2 - count.
+	    w := width.
+	    self catchExpose.
+	    self setViewOrigin:newOrigin.
+	    self copyFrom:self x:margin y:margin
+			     toX:margin y:(count + margin)
+			   width:w height:h.
+
+	    self setInnerClip.
+	    self redrawDeviceX:margin y:margin
+			 width:(width - m2)
+			height:count.
+
+	    self waitForExpose.
+	]
     ].
     self originChanged:(0 @ count negated).
 !
@@ -2117,7 +2131,7 @@
     |count "{ Class:SmallInteger }"
      m2    "{ Class:SmallInteger }"
      h     "{ Class:SmallInteger }"
-     orgX orgY|
+     orgX orgY newOrigin|
 
     transformation isNil ifTrue:[
 	orgY := orgX := 0
@@ -2133,27 +2147,33 @@
     (count <= 0) ifTrue:[^ self].
 
     self originWillChange.
-    self setViewOrigin:(orgX - count) @ orgY.
-
-    m2 := margin * 2.
-    (count >= self innerWidth) ifTrue:[
-	self redrawDeviceX:margin y:margin
-		     width:(width - m2)
-		    height:(height - m2).
-    ] ifFalse:[
-	h := (height - m2).
-
-	self catchExpose.
-	self copyFrom:self x:margin y:margin
-			 toX:(count + margin) y:margin
-		       width:(width - m2 - count) 
-		      height:h.
-
-	self setInnerClip.
-	self redrawDeviceX:margin y:margin
-		     width:count height:(height - m2).
-
-	self waitForExpose.
+    newOrigin := (orgX - count) @ orgY.
+
+    shown ifFalse:[
+	self setViewOrigin:newOrigin.
+    ] ifTrue:[
+	m2 := margin * 2.
+	(count >= self innerWidth) ifTrue:[
+	    self setViewOrigin:newOrigin.
+	    self redrawDeviceX:margin y:margin
+			 width:(width - m2)
+			height:(height - m2).
+	] ifFalse:[
+	    h := (height - m2).
+
+	    self catchExpose.
+	    self setViewOrigin:newOrigin.
+	    self copyFrom:self x:margin y:margin
+			     toX:(count + margin) y:margin
+			   width:(width - m2 - count) 
+			  height:h.
+
+	    self setInnerClip.
+	    self redrawDeviceX:margin y:margin
+			 width:count height:(height - m2).
+
+	    self waitForExpose.
+	]
     ].
     self originChanged:(count negated @ 0).
 !
@@ -2166,7 +2186,7 @@
      h     "{ Class:SmallInteger }" 
      wCont 
      iw    "{ Class:SmallInteger }"
-     orgX orgY|
+     orgX orgY newOrigin|
 
     wCont := self widthOfContents.
     transformation isNil ifTrue:[
@@ -2186,28 +2206,34 @@
     (count <= 0) ifTrue:[^ self].
 
     self originWillChange.
-    self setViewOrigin:(orgX + count) @ orgY.
-
-    m2 := margin * 2.
-    (count >= iw) ifTrue:[
-	self redrawDeviceX:margin y:margin
-		     width:(width - m2)
-		    height:(height - m2).
-    ] ifFalse:[
+    newOrigin := (orgX + count) @ orgY.
+
+    shown ifFalse:[
+	self setViewOrigin:newOrigin.
+    ] ifTrue:[
 	m2 := margin * 2.
-	h := (height - m2).
-
-	self catchExpose.
-	self copyFrom:self x:(count + margin) y:margin
-			 toX:margin y:margin
-		       width:(width - m2 - count) 
-		      height:h.
-
-	self setInnerClip.
-	self redrawDeviceX:(width - margin - count) y:margin 
-		     width:count height:(height - m2).
-
-	self waitForExpose.
+	(count >= iw) ifTrue:[
+	    self setViewOrigin:newOrigin.
+	    self redrawDeviceX:margin y:margin
+			 width:(width - m2)
+			height:(height - m2).
+	] ifFalse:[
+	    m2 := margin * 2.
+	    h := (height - m2).
+
+	    self catchExpose.
+	    self setViewOrigin:newOrigin.
+	    self copyFrom:self x:(count + margin) y:margin
+			     toX:margin y:margin
+			   width:(width - m2 - count) 
+			  height:h.
+
+	    self setInnerClip.
+	    self redrawDeviceX:(width - margin - count) y:margin 
+			 width:count height:(height - m2).
+
+	    self waitForExpose.
+	].
     ].
     self originChanged:(count @ 0).
 ! !