diff options
author | frosch <frosch@openttd.org> | 2015-02-01 20:54:24 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2015-02-01 20:54:24 +0000 |
commit | a8080b62563dcb9f3e3bf5180ebf2de6cf6b68ae (patch) | |
tree | 3ac628ab264823257073f281ce7e692f07e5c651 /src/company_gui.cpp | |
parent | 3bc7ee3ab731c7a855f811b36356ed907b42989a (diff) | |
download | openttd-a8080b62563dcb9f3e3bf5180ebf2de6cf6b68ae.tar.xz |
(svn r27134) -Codechange: Simplify GUI scaling by adding UnScaleGUI() and ScaleGUITrad().
Diffstat (limited to 'src/company_gui.cpp')
-rw-r--r-- | src/company_gui.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 31c5ed368..1343acb91 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -529,7 +529,7 @@ public: uint Height(uint width) const { - return max(FONT_HEIGHT_NORMAL, UnScaleByZoom(4 * 12, ZOOM_LVL_GUI) + 2); + return max(FONT_HEIGHT_NORMAL, ScaleGUITrad(12) + 2); } bool Selectable() const @@ -543,8 +543,12 @@ public: int height = bottom - top; int icon_y_offset = height / 2; int text_y_offset = (height - FONT_HEIGHT_NORMAL) / 2 + 1; - DrawSprite(SPR_VEH_BUS_SIDE_VIEW, PALETTE_RECOLOUR_START + this->result, rtl ? right - 2 - UnScaleByZoom(4 * 14, ZOOM_LVL_GUI) : left + UnScaleByZoom(4 * 14, ZOOM_LVL_GUI) + 2, top + icon_y_offset); - DrawString(rtl ? left + 2 : left + UnScaleByZoom(4 * 28, ZOOM_LVL_GUI) + 4, rtl ? right - UnScaleByZoom(4 * 28, ZOOM_LVL_GUI) - 4 : right - 2, top + text_y_offset, this->String(), sel ? TC_WHITE : TC_BLACK); + DrawSprite(SPR_VEH_BUS_SIDE_VIEW, PALETTE_RECOLOUR_START + this->result, + rtl ? right - 2 - ScaleGUITrad(14) : left + ScaleGUITrad(14) + 2, + top + icon_y_offset); + DrawString(rtl ? left + 2 : left + ScaleGUITrad(28) + 4, + rtl ? right - ScaleGUITrad(28) - 4 : right - 2, + top + text_y_offset, this->String(), sel ? TC_WHITE : TC_BLACK); } }; |