From 0fc0f0fc983b4760960d4d121cbad66ab428b4c0 Mon Sep 17 00:00:00 2001 From: PouleyKetchoupp Date: Sat, 9 Nov 2019 23:06:46 +0100 Subject: [PATCH] Fixed crash when using icon override in button Missing change for PR #33495 --- scene/gui/button.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index 23f2caa9fb3..ca4c255855e 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -179,7 +179,7 @@ void Button::_notification(int p_what) { if (icon_width > _size.width) { icon_width = _size.width; - icon_height = icon->get_height() * icon_width / _icon->get_width(); + icon_height = _icon->get_height() * icon_width / _icon->get_width(); } icon_region = Rect2(style->get_offset() + Point2(icon_ofs_region, (_size.height - icon_height) / 2), Size2(icon_width, icon_height));