From 1088ad48fceb19408f41f4f3caf0f9e525d977d9 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sun, 12 Oct 2014 20:43:25 +0000 Subject: (svn r27004) -Codechange: Make GUI size apply to (sprite-font) text as well. --- src/fontcache.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/fontcache.cpp') diff --git a/src/fontcache.cpp b/src/fontcache.cpp index 45a1b28dc..c8aca9852 100644 --- a/src/fontcache.cpp +++ b/src/fontcache.cpp @@ -18,6 +18,7 @@ #include "strings_func.h" #include "zoom_type.h" #include "gfx_layout.h" +#include "zoom_func.h" #include "table/sprites.h" #include "table/control_codes.h" @@ -80,6 +81,7 @@ public: virtual void ClearFontCache(); virtual const Sprite *GetGlyph(GlyphID key); virtual uint GetGlyphWidth(GlyphID key); + virtual int GetHeight() const; virtual bool GetDrawGlyphShadow(); virtual GlyphID MapCharToGlyph(WChar key) { assert(IsPrintable(key)); return SPRITE_GLYPH | key; } virtual const void *GetFontTable(uint32 tag, size_t &length) { length = 0; return NULL; } @@ -184,6 +186,11 @@ uint SpriteFontCache::GetGlyphWidth(GlyphID key) return SpriteExists(sprite) ? GetSprite(sprite, ST_FONT)->width + (this->fs != FS_NORMAL) : 0; } +int SpriteFontCache::GetHeight() const +{ + return UnScaleByZoom(4 * this->height, ZOOM_LVL_GUI); +} + bool SpriteFontCache::GetDrawGlyphShadow() { return false; -- cgit v1.2.3-70-g09d2