#BUGFIX by cg
authorClaus Gittinger <cg@exept.de>
Fri, 14 Oct 2016 19:25:27 +0200
changeset 5928 2bfec21329dd
parent 5927 8e2bb4c8c26b
child 5929 ea7162cefcc5
#BUGFIX by cg class: ListView comment/format in: #colOfX:inVisibleLine: changed: #getFontParameters a fontWidht of zero will kill me. treat as width 1 then.
ListView.st
--- a/ListView.st	Fri Oct 14 19:04:07 2016 +0200
+++ b/ListView.st	Fri Oct 14 19:25:27 2016 +0200
@@ -2713,8 +2713,7 @@
      for fix fonts, this is easy ...
     "
     (fontIsFixedWidth
-    and:[lineString isNil
-          or:[lineString hasChangeOfEmphasis not]]) ifTrue:[
+    and:[lineString isNil or:[lineString hasChangeOfEmphasis not]]) ifTrue:[
         ^ (xRel // fontWidth) + 1
     ].
 
@@ -2931,6 +2930,11 @@
     "/ fontAscent := font maxAscent "ascent". "/ maxAscent. -- see SelectionInListViews selection in motif style
     "/ fontAscent := (font maxAscent + font ascent) // 2. "/ maxAscent. -- see SelectionInListViews selection in motif style
     fontWidth := newDeviceFont width.
+    fontWidth == 0 ifTrue:[
+        "/ should not happen, but some bad fonts seem to have it
+        ('ListView [info]: font says, it has zero width: ', newDeviceFont printString) infoPrintCR.
+        fontWidth := 1.
+    ].    
     fontIsFixedWidth := newDeviceFont isFixedWidth.
 
     "Modified: 3.7.1997 / 12:24:25 / cg"