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.
This commit is contained in:
Charles Dang 2017-06-10 03:48:28 +11:00
parent 6f1a13c3a6
commit 05210ae1f2

View file

@ -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]