From 52c94ae7e8dc10716a6f212b2cd81916d46b29b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Sat, 29 Apr 2017 08:56:38 -0400 Subject: [PATCH] gamnit: fix X position of first char of a TextSprites MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/gamnit/tileset.nit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/gamnit/tileset.nit b/lib/gamnit/tileset.nit index 67bd32c..f932f61 100644 --- a/lib/gamnit/tileset.nit +++ b/lib/gamnit/tileset.nit @@ -157,12 +157,12 @@ class TextSprites if text == null then return # Build new sprites - var dx = font.vspace.to_f/2.0 + var dx = font.advance/2.0 var dy = font.hspace.to_f/2.0 for c in text do if c == '\n' then dy -= font.height.to_f + font.vspace.to_f - dx = font.vspace.to_f/2.0 + dx = font.advance/2.0 continue else if c.is_whitespace then dx += font.advance -- 1.7.9.5