浏览代码

Fixed crash when using icon override in button

Missing change for PR #33495
PouleyKetchoupp 5 年之前
父节点
当前提交
0fc0f0fc98
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scene/gui/button.cpp

+ 1 - 1
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));