ListView.st
changeset 1656 1202fbc95970
parent 1637 f40b75c349d7
child 1693 e76979454c2f
--- a/ListView.st	Wed Sep 02 17:40:16 1998 +0200
+++ b/ListView.st	Fri Sep 04 18:27:18 1998 +0200
@@ -1334,14 +1334,14 @@
                     lineString := characterString
                 ].
                 self paint:bg.
-                fontIsFixedWidth ifTrue:[
-                    w := (endCol - sCol + 1) * fontWidth
+                (lineString isMemberOf:String) ifTrue:[
+                    fontIsFixedWidth ifTrue:[
+                        w := (endCol - sCol + 1) * fontWidth
+                    ] ifFalse:[
+                        w := font widthOf:lineString from:sCol to:endCol
+                    ]
                 ] ifFalse:[
-                    (lineString isMemberOf:String) ifTrue:[
-                        w := font widthOf:lineString from:sCol to:endCol
-                    ] ifFalse:[
-                        w := (lineString copyFrom:sCol to:endCol) widthOn:self
-                    ]
+                    w := (lineString copyFrom:sCol to:endCol) widthOn:self
                 ].
                 self fillRectangleX:x y:yf 
                               width:w
@@ -1352,7 +1352,7 @@
         ]
     ]
 
-    "Modified: / 16.6.1998 / 13:19:11 / cg"
+    "Modified: / 3.9.1998 / 21:54:01 / cg"
 !
 
 drawVisibleLine:visLineNr from:startCol with:fg and:bg
@@ -1769,17 +1769,20 @@
     xRel := x - textStartLeft + leftOffset.
     (xRel <= 0) ifTrue:[^ 1].
 
+    lineString := self visibleAt:visLineNr.
+
     "
      for fix fonts, this is easy ...
     "
-    fontIsFixedWidth ifTrue:[
+    (fontIsFixedWidth 
+    and:[lineString isNil
+         or:[lineString isMemberOf:String]]) ifTrue:[
         ^ (xRel // fontWidth) + 1
     ].
 
     "
      for variable fonts, more work is required ...
     "
-    lineString := self visibleAt:visLineNr.
     lineString notNil ifTrue:[
         lineString := lineString asString.
         (hasEmphasis := lineString hasChangeOfEmphasis) ifTrue:[
@@ -1854,7 +1857,7 @@
 
     ^ runCol
 
-    "Modified: / 28.7.1998 / 12:17:40 / cg"
+    "Modified: / 3.9.1998 / 21:55:41 / cg"
 !
 
 computeNumberOfLinesShown
@@ -2268,30 +2271,32 @@
     |line lineSize tcol|
 
     tcol := col - 1.
-    fontIsFixedWidth ifTrue:[
-	^ (tcol * fontWidth) + textStartLeft
+    line := self visibleAt:visLineNr.
+    (fontIsFixedWidth 
+    and:[line isNil
+         or:[line isMemberOf:String]]) ifTrue:[
+        ^ (tcol * fontWidth) + textStartLeft
     ].
-    line := self visibleAt:visLineNr.
     line notNil ifTrue:[
-	lineSize := line size
+        lineSize := line size
     ] ifFalse:[
-	lineSize := 0
+        lineSize := 0
     ].
     (lineSize == 0) ifTrue:[
-	^ (tcol * fontWidth) + textStartLeft
+        ^ (tcol * fontWidth) + textStartLeft
     ].
 
     (lineSize < col) ifTrue:[
-	^ (line widthOn:self) 
-	  + (fontWidth * (tcol - lineSize)) 
-	  + textStartLeft
+        ^ (line widthOn:self) 
+          + (fontWidth * (tcol - lineSize)) 
+          + textStartLeft
     ].
     (line isMemberOf:String) ifTrue:[
-	^ (font widthOf:line from:1 to:tcol) + textStartLeft
+        ^ (font widthOf:line from:1 to:tcol) + textStartLeft
     ].
     ^ ((line copyTo:tcol) widthOn:self) + textStartLeft
 
-    "Modified: 19.7.1996 / 20:38:54 / cg"
+    "Modified: / 3.9.1998 / 21:56:33 / cg"
 !
 
 yOfLine:lineNr
@@ -3785,5 +3790,5 @@
 !ListView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.172 1998-08-07 17:56:43 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.173 1998-09-04 16:27:18 cg Exp $'
 ! !