#TUNING by cg
authorClaus Gittinger <cg@exept.de>
Thu, 14 Apr 2016 20:53:22 +0200
changeset 5022 c2e58c679b8e
parent 5021 a24473f2d6ca
child 5026 c0ed4e85a203
child 5027 e7feddec2933
#TUNING by cg class: ImageView changed: #redrawX:y:width:height: avoid flicker by not clearing if there is no mask
ImageView.st
--- a/ImageView.st	Thu Apr 14 12:54:44 2016 +0200
+++ b/ImageView.st	Thu Apr 14 20:53:22 2016 +0200
@@ -525,15 +525,15 @@
 
         tileMode == true ifTrue:[
             (tileOffset y > 0 and:[tileOffset x > 0]) ifTrue:[
-                (depth == 1
-                and:[image mask isNil]) ifFalse:[
+                (false "depth ~~ 1"
+                or:[shownImage mask notNil]) ifTrue:[
                     self clearRectangleX:x y:y width:w height:h.
                     0 to:y+h by:tileOffset y do:[:oY |
                         0 to:x+w by:tileOffset x do:[:oX |
                             self displayForm:image x:oX y:oY 
                         ]
                     ].
-                ] ifTrue:[
+                ] ifFalse:[
                     0 to:y+h by:tileOffset y do:[:oY |
                         0 to:x+w by:tileOffset x do:[:oX |
                             self displayOpaqueForm:image x:oX y:oY 
@@ -547,7 +547,7 @@
             (xI+imgWidth) < x ifTrue:[^ self]. "/ no need to draw
             (yI+imgHeight) < y ifTrue:[^ self]. "/ no need to draw
 
-            (depth ~~ 1
+            (false "depth ~~ 1"
             or:[shownImage mask notNil]) ifTrue:[
                 self clearRectangleX:x y:y width:w height:h.
                 shownImage displayOn:self x:xI y:yI.
@@ -559,18 +559,14 @@
             "/ right of image ?
             right := x + w - 1.
             right > (xI + imgWidth) ifTrue:[
-                self clearRectangleX:(xI + imgWidth)
-                                   y:y
-                               width:(right - imgWidth - xI)
-                              height:h  
+                self clearRectangleX:(xI + imgWidth) y:y
+                               width:(right - imgWidth - xI) height:h  
             ].
             "/ below of image ?
             bott := y + h - 1.
             bott > (yI + imgHeight) ifTrue:[
-                self clearRectangleX:margin
-                                   y:(yI + imgHeight)
-                               width:w
-                              height:(bott - imgHeight - yI)  
+                self clearRectangleX:margin y:(yI + imgHeight)
+                               width:w height:(bott - imgHeight - yI)  
             ].
         ].
     ]