]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Fixed display of some characters in playernick (e.g. . : |)
authorJan D. Behrens <zykure@web.de>
Thu, 30 Aug 2012 11:38:32 +0000 (13:38 +0200)
committerJan D. Behrens <zykure@web.de>
Thu, 30 Aug 2012 11:38:32 +0000 (13:38 +0200)
xonstat/batch/badges/skin.py

index 40ae0eb3712cf80a09a758f52d608a64d9c6f74e..56bc1d09b3bdbc1cb73e890c2aa43b48813ac216 100644 (file)
@@ -310,12 +310,12 @@ class Skin:
                     r,g,b = _dec_colors[int(tag[0])]
             else:
                 r,g,b = _dec_colors[7]
-            
+
+            xoff, yoff, tw, th = ctx.text_extents(txt)[:4]
             ctx.set_source_rgb(r, g, b)
-            ctx.move_to(self.nick_pos[0] + xoffset, self.nick_pos[1])
+            ctx.move_to(self.nick_pos[0] + xoffset - xoff, self.nick_pos[1])
             ctx.show_text(txt)
 
-            xoff, yoff, tw, th = ctx.text_extents(txt)[:4]
             tw += (len(txt)-len(txt.strip())) * space_w  # account for lost whitespaces
             xoffset += tw + 2