Fix minimum size of ProgressBar-s

Was a leftover from 0a1c1c660f.
Fixes #21633.
This commit is contained in:
Bojidar Marinov 2019-02-27 15:56:49 +02:00
parent 22ee7ba4f0
commit a7b564db6e
No known key found for this signature in database
GPG key ID: 4D546A8F1E091856
2 changed files with 7 additions and 3 deletions

View file

@ -231,6 +231,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
}
pb->set_percent_visible(false);
pb->set_custom_minimum_size(Vector2(0, 14) * EDSCALE);
animations[E->get()] = pb;
node->add_child(pb);

View file

@ -39,9 +39,12 @@ Size2 ProgressBar::get_minimum_size() const {
Size2 minimum_size = bg->get_minimum_size();
minimum_size.height = MAX(minimum_size.height, fg->get_minimum_size().height);
minimum_size.width = MAX(minimum_size.width, fg->get_minimum_size().width);
//if (percent_visible) { this is needed, else the progressbar will collapse
if (percent_visible) {
minimum_size.height = MAX(minimum_size.height, bg->get_minimum_size().height + font->get_height());
//}
} else { // this is needed, else the progressbar will collapse
minimum_size.width = MAX(minimum_size.width, 1);
minimum_size.height = MAX(minimum_size.height, 1);
}
return minimum_size;
}