Skip to content

Commit 9fb3bb3

Browse files
Fixes pixelsize in Windows
1 parent 3015fc8 commit 9fb3bb3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/robotide/editor/cellrenderer.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ def GetBestSize(self, grid, attr, dc, row, col):
6161
# margin = 2 # get border width into account when submitting optimal col size
6262
margin = 0
6363
w, h = _font.GetPixelSize()
64+
h = max( h, 12) # Probably h==0 on MSW, w==0 means width auto
65+
w = max( w, 12)
6466
if len(text) > 0:
6567
w_sz = w * len(text) + 2 * w
6668
else:
@@ -77,6 +79,8 @@ def GetBestSize(self, grid, attr, dc, row, col):
7779
text = wordwrap.wordwrap(text, col_width, dc, breakLongWords=False,
7880
margin=margin)
7981
w, h = dc.GetMultiLineTextExtent(text)
82+
h = max( h, 12) # Probably h==0 on MSW, w==0 means width auto
83+
w = max( w, 12)
8084
else:
8185
w = col_width
8286
if self.auto_fit:

0 commit comments

Comments
 (0)