From b0b58603dd2c2aba312e591dcc339d934931da0c Mon Sep 17 00:00:00 2001 From: "Jan D. Behrens" Date: Fri, 14 Sep 2012 22:03:03 +0200 Subject: [PATCH] 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) --- xonstat/batch/badges/skin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.39.2