View.st
changeset 116 c0db6a8ab4ac
parent 113 60981f3775c6
child 118 25e775072a89
--- a/View.st	Tue Mar 07 22:57:31 1995 +0100
+++ b/View.st	Thu Mar 09 03:10:17 1995 +0100
@@ -45,7 +45,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libview/View.st,v 1.33 1995-03-06 19:22:29 claus Exp $
+$Header: /cvs/stx/stx/libview/View.st,v 1.34 1995-03-09 02:10:17 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.33 1995-03-06 19:22:29 claus Exp $
+$Header: /cvs/stx/stx/libview/View.st,v 1.34 1995-03-09 02:10:17 claus Exp $
 "
 !
 
@@ -617,13 +617,13 @@
     borderWidth := DefaultBorderWidth.
     borderWidth isNil ifTrue:[borderWidth := 1].
 
-    viewBackground := DefaultViewBackgroundColor on:device.
+    viewBackground := DefaultViewBackgroundColor "on:device".
 
     DefaultLightColor notNil ifTrue:[
 	lightColor := DefaultLightColor.
     ] ifFalse:[
 	device hasGreyscales ifTrue:[
-	    lightColor := viewBackground lightened
+	    DefaultLightColor := lightColor := viewBackground lightened.
 	] ifFalse:[
 	    "
 	     this seems strange: on B&W light color is darker than
@@ -639,9 +639,9 @@
 	shadowColor := Black
     ].
 
-    lightColor := lightColor on:device.
-    shadowColor := shadowColor on:device.
-    borderColor := DefaultBorderColor on:device.
+    lightColor := lightColor "on:device".
+    shadowColor := shadowColor "on:device".
+    borderColor := DefaultBorderColor " on:device".
     font := DefaultFont on:device.
 !
 
@@ -1840,14 +1840,15 @@
 	    margin := level abs.
 
 	    realized ifTrue:[
-		(margin > oldMargin) ifTrue:[
-		    how := #smaller
-		] ifFalse:[
-		    how := #larger
+		margin ~~ oldMargin ifTrue:[
+		    (margin > oldMargin) ifTrue:[
+			how := #smaller
+		    ] ifFalse:[
+			how := #larger
+		    ].
+		    self sizeChanged:how.
+		    self setInnerClip.
 		].
-		self sizeChanged:how.
-"/                self computeInnerClip.
-		self setInnerClip.
 		shown ifTrue:[
 		    self redrawEdges
 		]
@@ -2630,13 +2631,13 @@
     bw := borderWidth.
 
     superView isNil ifTrue:[
-	superWidth := device width.      
-	superHeight := device height.
+	superWidth := device width + bw.      
+	superHeight := device height + bw.
 	superLeft := superTop := 0.
     ] ifFalse:[
 	inRect := superView viewRectangle.
-	superWidth := inRect width - bw.
-	superHeight := inRect height - bw.
+	superWidth := inRect width.
+	superHeight := inRect height.
 	superLeft := inRect left.
 	superTop := inRect top.
     ].
@@ -2645,7 +2646,7 @@
     rel isInteger ifTrue:[
 	newX := rel
     ] ifFalse:[
-	newX := (rel * (superWidth + bw)) asInteger + superLeft.
+	newX := (rel * superWidth) asInteger + superLeft.
 	(bw ~~ 0) ifTrue:[
 	    rel ~= 1.0 ifTrue:[
 		newX := newX - bw
@@ -2657,7 +2658,7 @@
     rel isInteger ifTrue:[
 	newY := rel
     ] ifFalse:[
-	newY := (rel * (superHeight + bw)) asInteger + superTop.
+	newY := (rel * superHeight) asInteger + superTop.
 	(bw ~~ 0) ifTrue:[
 	    rel ~= 1.0 ifTrue:[
 		newY := newY - bw
@@ -2917,8 +2918,8 @@
     extentChanged := false.
     originChanged := false.
 
-    (borderColor and:[borderColor ~~ Black]) ifTrue:[
-	borderColor := borderColor on:device.
+    (borderColor notNil and:[borderColor ~~ Black]) ifTrue:[
+"/        borderColor := borderColor on:device.
 	self setBorderColor
     ].
     (viewGravity notNil "and:[viewGravity ~~ #NorthWest]") ifTrue:[