Fix some ways to create inconsistent Viewport sizes

In the editor, it was possible to set the size of a `SubViewport` even
in cases where a parent `SubViewportContainer` had stretch enabled.

This PR disables editing a `SubViewport.size` while the parent disallows
it and it makes necessary adjustments during `NOTIFICATION_ENTER_TREE`.
This commit is contained in:
Markus Sauermann
2023-02-13 00:34:16 +01:00
parent 72c5b56d04
commit 34a7fc7447
4 changed files with 26 additions and 14 deletions

View File

@ -58,6 +58,7 @@ public:
virtual void unhandled_input(const Ref<InputEvent> &p_event) override;
void set_stretch_shrink(int p_shrink);
int get_stretch_shrink() const;
void recalc_force_viewport_sizes();
virtual Size2 get_minimum_size() const override;