From: Jan D. Behrens Date: Fri, 14 Sep 2012 20:03:03 +0000 (+0200) Subject: Minor improvements to the badges generator: X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b0b58603dd2c2aba312e591dcc339d934931da0c;p=xonotic%2Fxonstat.git Minor improvements to the badges generator: - Fixed mistake int the ^6 color code (leading to wrong colors) - Extended the playernick down-scaling for too wide nicks (now max. down-scaling is based on fontsize) --- diff --git a/xonstat/batch/badges/skin.py b/xonstat/batch/badges/skin.py index 56bc1d0..399bb79 100644 --- a/xonstat/batch/badges/skin.py +++ b/xonstat/batch/badges/skin.py @@ -15,7 +15,7 @@ _dec_colors = [ (0.5,0.5,0.5), (1.0,1.0,0.0), (0.2,0.4,1.0), (0.2,1.0,1.0), - (1.0,0.2,102), + (1.0,0.2,0.4), (1.0,1.0,1.0), (0.6,0.6,0.6), (0.5,0.5,0.5) @@ -266,11 +266,11 @@ class Skin: # fontsize is reduced if width gets too large ctx.select_font_face(self.font, C.FONT_SLANT_NORMAL, C.FONT_WEIGHT_NORMAL) shrinknick = 0 - while shrinknick < 10: + while shrinknick < 0.6*fontsize: ctx.set_font_size(self.nick_fontsize - shrinknick) xoff, yoff, tw, th = ctx.text_extents(stripped_nick)[:4] if tw > self.nick_maxwidth: - shrinknick += 2 + shrinknick += 1 continue break