aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsrc/__main__.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/__main__.py b/src/__main__.py
index 16c935f..c502d7c 100755
--- a/src/__main__.py
+++ b/src/__main__.py
@@ -175,9 +175,15 @@ class Bar:
self.gc.change(foreground = fc, background = bc)
if clear is not None:
(clear_y, line_height) = clear
+ ascent = line_height - self.font_height
for c in text + '\0':
if c in special:
if not buf == '':
+ text_width = self.font_width * len(buf)
+ if clear is not None:
+ self.change_colour(self.background)
+ self.window.fill_rectangle(self.gc, x, clear_y, text_width, ascent)
+ self.gc.change(foreground = fc, background = bc)
if len(buf.encode('utf-8')) > 255:
while not buf == '':
sbuf, buf = buf[:42], buf[42:]
@@ -185,7 +191,7 @@ class Bar:
x += self.font_width * len(sbuf)
else:
draw_text(self.window, self.gc, x, y, buf)
- x += self.font_width * len(buf)
+ x += text_width
buf = ''
if not c == '\0':
segs = []