You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-13 13:31:48 +00:00
Fix case where h_separation might not work in Button
This patch mainly solves two things: 1. The typo of `h_separation`; 2. Negative values of `h_separation` will be treated as `0` when used, to prevent the button's minimum `width` from being reduced by `h_separation`.
This commit is contained in:
@@ -52,7 +52,7 @@ Size2 CheckButton::get_minimum_size() const {
|
||||
Size2 tex_size = get_icon_size();
|
||||
minsize.width += tex_size.width;
|
||||
if (get_text().length() > 0) {
|
||||
minsize.width += get_theme_constant(SNAME("h_separation"));
|
||||
minsize.width += MAX(0, get_theme_constant(SNAME("h_separation")));
|
||||
}
|
||||
Ref<StyleBox> sb = get_theme_stylebox(SNAME("normal"));
|
||||
minsize.height = MAX(minsize.height, tex_size.height + sb->get_margin(SIDE_TOP) + sb->get_margin(SIDE_BOTTOM));
|
||||
|
||||
Reference in New Issue
Block a user