Commit graph

20 commits

Author SHA1 Message Date
Rémi Verschelde
3018178d3f
Merge pull request #94286 from aaronp64/flowcontainer_resort_crash
Avoid `FlowContainer` crash with `TextureRect` using EXPAND_FIT_* expand modes
2024-07-22 14:12:48 +02:00
aaronp64
5682cc7b81 Avoid FlowContainer crash with TextureRect using EXPAND_FIT_* expand modes
When a FlowContainer had a TextureRect child using any of the EXPAND_FIT_* expand modes, it could crash when changing the FlowContainer's minimum size, or that of its children.  This was due to the TextureRect resizing in FlowContainer::_resort, updating its minimum size, and triggering another _resort.  If the TextureRect's minimum size changed in a way that caused any of the FlowContainer's children to be put on a different line, it could repeatedly cause _resort to be called again, moving the children back and forth between the old and new lines.

This change is for FlowContainer::_resort to give a warning for TextureRects with EXPAND_FIT_* expand modes when multiple lines are used, and just keep the TextureRect size the same in that case.  This is similar to the check added to AspectRatioContainer in godotengine#73396, but attempting to still support it in FlowContainer when possible.  In the case where the TextureRect is forced to stay the same size, there may be some overlap between the FlowContainer's children, but should no longer crash.
2024-07-21 13:09:22 -04:00
Anni Ryynänen
a9c91f4eef
Fix container minimum size with hidden parent 2024-07-12 16:21:05 +03:00
Javi Rodriguez
d6e17b8a0d Fix FlowContainer scale from also scaling wrap point
When a FlowContainer was scaled, the point at which a line wraps would
also be scaled. This would cause a FlowContainer to have lines that did
not fit the container.

FlowContainer no longer factors its scale when resorting children.

Fixes #93439
2024-06-21 19:13:43 -04:00
kobewi
5c28814b39 Add as_sortable_control() to unify Container checks 2024-05-08 11:45:52 +02:00
Koyper
e3efd51592 Add FlowContainer wrap options for center alignment. 2024-04-29 08:26:45 -05:00
TheSecondReal0
b8a7270567 Add option to reverse FlowContainer fill direction (HFlow bottom-to-top, VFlow right-to-left) 2024-02-01 10:41:31 -07:00
Yuri Sizov
2924bfd4d3 Register theme properties with ThemeDB 2023-09-11 13:45:23 +02:00
Juan Linietsky
47592927b3 Use BitField<> hint for ArrayFormat
This was missing in the conversion of bitflags to BitField<>.
2023-01-08 18:47:48 +01:00
Rémi Verschelde
d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
Teggy
2b08675f37 Add alignment options to flow container 2022-10-23 13:40:17 +02:00
kobewi
73929bef73 Rework oriented containers 2022-09-01 22:13:46 +02:00
Yuri Sizov
3b1aa240dc Add a lifecycle method for manual theme item caching to Control 2022-09-01 16:35:36 +03:00
reduz
746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
FireForge
3073b85de9 Rename theme properties to include underscores
- check_vadjust -> check_v_adjust
- close_h_ofs -> close_h_offset
- close_v_ofs -> close_v_offset
- commentfocus -> comment_focus
- hseparation -> h_separation
- ofs -> offset
- selectedframe -> selected_frame
- state_machine_selectedframe -> state_machine_selected_frame
- table_hseparation -> table_h_separation
- table_vseparation -> table_v_separation
- vseparation -> v_separation
2022-04-23 11:16:18 -05:00
taigi100
280956ddc3 Fix children visibility check 2022-03-16 15:51:27 +02:00
Rémi Verschelde
0f5455230c
Use switch consistently in _notification (scene folder) 2022-02-15 18:44:55 +01:00
Hendrik Brucker
b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Yuri Sizov
107b6f299c Reorganize inspector layout workflow for Control nodes 2022-02-10 20:29:34 +03:00
Hendrik Brucker
40ee2b8953 Add FlowContainer 2022-01-07 15:51:49 +01:00