Skip to content

Commit 694baff

Browse files
authored
Merge pull request #60932 from Geometror/button-fix-expand-icon
2 parents 917fd65 + c09a5e2 commit 694baff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scene/gui/button.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ void Button::_notification(int p_what) {
258258

259259
if (expand_icon) {
260260
Size2 _size = get_size() - style->get_offset() * 2;
261-
_size.width -= get_theme_constant(SNAME("h_separation")) + icon_ofs_region;
261+
int icon_text_separation = text.is_empty() ? 0 : get_theme_constant(SNAME("h_separation"));
262+
_size.width -= icon_text_separation + icon_ofs_region;
262263
if (!clip_text && icon_align_rtl_checked != HORIZONTAL_ALIGNMENT_CENTER) {
263264
_size.width -= text_buf->get_size().width;
264265
}

0 commit comments

Comments
 (0)