]> git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/batch/badges/skin.py
Fixed display of some characters in playernick (e.g. . : |)
[xonotic/xonstat.git] / 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