From 0976ad8c9ccab4d7f253fc12c50cebea669486ac Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Sat, 10 Jun 2017 03:48:28 +1100 Subject: [PATCH] GUI2: fixed some overlay drawing issues with icon toggle buttons Not sure why, but in some cases the overlay calculations were getting screwed up. This makes them use the general centered image macro, with accompanying fallback safety checks. --- data/gui/widget/toggle_button_icon.cfg | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/data/gui/widget/toggle_button_icon.cfg b/data/gui/widget/toggle_button_icon.cfg index 6145f85dc4ac..15ba02434deb 100644 --- a/data/gui/widget/toggle_button_icon.cfg +++ b/data/gui/widget/toggle_button_icon.cfg @@ -5,10 +5,10 @@ ### extended for usage with other widgets. ### -#define _GUI_ICON SIZE +#define _GUI_ICON [image] - x = "(size / 2 - image_width / 2 where size = {SIZE})" - y = "(size / 2 - image_height / 2 where size = {SIZE})" + {GUI_CENTERED_IMAGE} + name = "(icon)" [/image] #enddef @@ -43,7 +43,7 @@ name = "buttons/button_square/button_square_30.png" [/image] - {_GUI_ICON ({SIZE})} + {_GUI_ICON} [/draw] @@ -61,7 +61,7 @@ name = "buttons/button_square/button_square_30.png" [/image] - {_GUI_ICON ({SIZE})} + {_GUI_ICON} [/draw] @@ -79,7 +79,7 @@ name = "buttons/button_square/button_square_30-active.png" [/image] - {_GUI_ICON ({SIZE})} + {_GUI_ICON} [/draw] @@ -103,7 +103,7 @@ name = "buttons/button_square/button_square_30-pressed.png" [/image] - {_GUI_ICON ({SIZE})} + {_GUI_ICON} [/draw] @@ -121,7 +121,7 @@ name = "buttons/button_square/button_square_30-pressed.png" [/image] - {_GUI_ICON ({SIZE})} + {_GUI_ICON} [/draw] @@ -139,7 +139,7 @@ name = "buttons/button_square/button_square_30-active-pressed.png" [/image] - {_GUI_ICON ({SIZE})} + {_GUI_ICON} [/draw]