Merge pull request #73396 from KoBeWi/sorry
Fix crash with AspectRatioContainer and TextureRect
This commit is contained in:
commit
25da47edd6
2 changed files with 14 additions and 1 deletions
|
|
@ -30,6 +30,8 @@
|
|||
|
||||
#include "aspect_ratio_container.h"
|
||||
|
||||
#include "scene/gui/texture_rect.h"
|
||||
|
||||
Size2 AspectRatioContainer::get_minimum_size() const {
|
||||
Size2 ms;
|
||||
for (int i = 0; i < get_child_count(); i++) {
|
||||
|
|
@ -113,6 +115,16 @@ void AspectRatioContainer::_notification(int p_what) {
|
|||
if (c->is_set_as_top_level()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Temporary fix for editor crash.
|
||||
TextureRect *trect = Object::cast_to<TextureRect>(c);
|
||||
if (trect) {
|
||||
if (trect->get_expand_mode() == TextureRect::EXPAND_FIT_WIDTH_PROPORTIONAL || trect->get_expand_mode() == TextureRect::EXPAND_FIT_HEIGHT_PROPORTIONAL) {
|
||||
WARN_PRINT_ONCE("Proportional TextureRect is currently not supported inside AspectRatioContainer");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Size2 child_minsize = c->get_combined_minimum_size();
|
||||
Size2 child_size = Size2(ratio, 1.0);
|
||||
float scale_factor = 1.0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue