slight redraw-tuning
authorClaus Gittinger <cg@exept.de>
Tue, 18 May 1999 21:19:59 +0200
changeset 1908 3862a49ad525
parent 1907 b923d3828da2
child 1909 27778cfa4bda
slight redraw-tuning
Scroller.st
--- a/Scroller.st	Tue May 18 14:17:44 1999 +0200
+++ b/Scroller.st	Tue May 18 21:19:59 1999 +0200
@@ -1616,7 +1616,7 @@
 sizeChanged:how
     "size of scroller changed - recompute thumbs frame and redraw it"
 
-    |oldThumbFrame oldTop oldBot newTop newBot|
+    |oldThumbFrame oldTop oldBot newTop newBot oldLeft oldRight newLeft newRight|
 
     oldThumbFrame := thumbFrame.
     thumbFrame := nil.
@@ -1628,12 +1628,31 @@
                 ^ self
             ].
 
-"/            "/ try to redraw as little as possible
-"/            orientation == #vertical ifTrue:[
-"/                oldTop := oldThumbFrame top.
-"/                oldBot := oldThumbFrame bottom.
-"/                newTop := thumbFrame top.
-"/                newBot := thumbFrame bottom.
+            "/ try to redraw as little as possible
+
+            oldTop := oldThumbFrame top.
+            oldBot := oldThumbFrame bottom.
+            newTop := thumbFrame top.
+            newBot := thumbFrame bottom.
+            oldLeft := oldThumbFrame left.
+            oldRight := oldThumbFrame right.
+            newLeft := thumbFrame left.
+            newRight := thumbFrame right.
+
+            (orientation == #vertical
+            and:[oldLeft == newLeft
+            and:[oldRight == newRight]]) ifTrue:[
+                (oldTop == newTop) ifTrue:[
+                    oldBot < newBot ifTrue:[
+                        "/ thumb became larger, but origin remains
+                        "/ (view became larger)
+                        self invalidate:(Rectangle 
+                                            left:newLeft top:oldBot
+                                            right:newRight bottom:newBot).
+                        ^ self.
+                    ]
+                ].
+
 "/                newTop <= oldTop ifTrue:[
 "/                    newBot >= oldBot ifTrue:[
 "/                        self drawThumb.
@@ -1644,14 +1663,30 @@
 "/                    self drawThumbBackgroundInX:0 y:oldTop width:width height:(newTop-oldTop).
 "/                    self drawThumb.
 "/                ]
-"/            ]
+            ].
+
+            (orientation == #horizontal
+            and:[oldTop == newTop
+            and:[oldBot == newBot]]) ifTrue:[
+                (oldLeft == newLeft) ifTrue:[
+                    oldRight < newRight ifTrue:[
+                        "/ thumb became larger, but origin remains
+                        "/ (view became larger)
+                        self invalidate:(Rectangle 
+                                            left:oldRight top:newTop
+                                            right:newRight bottom:newBot).
+                        ^ self.
+                    ]
+                ]
+            ].
+
             self invalidate:(oldThumbFrame merge: thumbFrame).
             ^ self.
         ].
         self invalidate
     ].
 
-    "Modified: / 29.4.1999 / 09:43:12 / cg"
+    "Modified: / 15.5.1999 / 14:21:45 / cg"
 !
 
 update:something with:aParameter from:changedObject
@@ -2343,5 +2378,5 @@
 !Scroller class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.130 1999-05-04 17:14:41 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.131 1999-05-18 19:19:59 cg Exp $'
 ! !