dont catchExpose, if copy is empty
authorClaus Gittinger <cg@exept.de>
Tue, 28 Jan 1997 22:44:03 +0100
changeset 981 6e52d3876ea7
parent 980 6079922a5519
child 982 bd9d2993a1be
dont catchExpose, if copy is empty
ETxtView.st
EditTextView.st
--- a/ETxtView.st	Tue Jan 28 18:05:55 1997 +0100
+++ b/ETxtView.st	Tue Jan 28 22:44:03 1997 +0100
@@ -2217,7 +2217,7 @@
     "split the line linNr before colNr; the right part (from colNr)
      is cut off and inserted after lineNr; the view is redrawn"
 
-    |line lineSize leftRest rightRest visLine w      
+    |line lineSize leftRest rightRest visLine w h mustWait    
      srcY    "{ Class: SmallInteger }" |
 
     list isNil ifFalse:[
@@ -2249,14 +2249,17 @@
                 w := self widthForScrollBetween:lineNr
                                             and:(firstLineShown + nLinesShown).
                 srcY := topMargin + (visLine * fontHeight).
-                self catchExpose.
-                self copyFrom:self x:textStartLeft y:srcY
-                                 toX:textStartLeft y:(srcY + fontHeight)
-                               width:w
-                              height:((nLinesShown - visLine - 1) * fontHeight).
+                h := ((nLinesShown - visLine - 1) * fontHeight).
+                (mustWait := (w > 0 and:[h > 0])) ifTrue:[
+                    self catchExpose.
+                    self copyFrom:self x:textStartLeft y:srcY
+                                     toX:textStartLeft y:(srcY + fontHeight)
+                                   width:w
+                                  height:((nLinesShown - visLine - 1) * fontHeight).
+                ].
                 self redrawLine:lineNr.
                 self redrawLine:(lineNr + 1).
-                self waitForExpose
+                mustWait ifTrue:[self waitForExpose]
             ].
             widthOfWidestLine := nil. "/ unknown
             self textChanged.
@@ -3901,5 +3904,5 @@
 !EditTextView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Attic/ETxtView.st,v 1.104 1997-01-18 15:24:27 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Attic/ETxtView.st,v 1.105 1997-01-28 21:44:03 cg Exp $'
 ! !
--- a/EditTextView.st	Tue Jan 28 18:05:55 1997 +0100
+++ b/EditTextView.st	Tue Jan 28 22:44:03 1997 +0100
@@ -2217,7 +2217,7 @@
     "split the line linNr before colNr; the right part (from colNr)
      is cut off and inserted after lineNr; the view is redrawn"
 
-    |line lineSize leftRest rightRest visLine w      
+    |line lineSize leftRest rightRest visLine w h mustWait    
      srcY    "{ Class: SmallInteger }" |
 
     list isNil ifFalse:[
@@ -2249,14 +2249,17 @@
                 w := self widthForScrollBetween:lineNr
                                             and:(firstLineShown + nLinesShown).
                 srcY := topMargin + (visLine * fontHeight).
-                self catchExpose.
-                self copyFrom:self x:textStartLeft y:srcY
-                                 toX:textStartLeft y:(srcY + fontHeight)
-                               width:w
-                              height:((nLinesShown - visLine - 1) * fontHeight).
+                h := ((nLinesShown - visLine - 1) * fontHeight).
+                (mustWait := (w > 0 and:[h > 0])) ifTrue:[
+                    self catchExpose.
+                    self copyFrom:self x:textStartLeft y:srcY
+                                     toX:textStartLeft y:(srcY + fontHeight)
+                                   width:w
+                                  height:((nLinesShown - visLine - 1) * fontHeight).
+                ].
                 self redrawLine:lineNr.
                 self redrawLine:(lineNr + 1).
-                self waitForExpose
+                mustWait ifTrue:[self waitForExpose]
             ].
             widthOfWidestLine := nil. "/ unknown
             self textChanged.
@@ -3901,5 +3904,5 @@
 !EditTextView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.104 1997-01-18 15:24:27 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.105 1997-01-28 21:44:03 cg Exp $'
 ! !