always reset _needsLayout in -layout and not only

-layoutSubtreeIfNeeded via layoutViewAndSubvies.

Apple states for -(void) layout:

Override this method if your custom view needs to perform custom layout not expressible using the constraint-based layout system. In this case you are responsible for setting needsLayout to true when something that impacts your custom layout changes.

Which seems to suggest that layout does the reset of needsLayout, since
setting it is up to programmer.
This commit is contained in:
Riccardo Mottola 2025-03-04 23:56:39 +01:00
parent 4c1687d2b4
commit 5917f0519b

View file

@ -5172,6 +5172,8 @@ static NSView* findByTag(NSView *view, NSInteger aTag, NSUInteger *level)
- (void) layout
{
_needsLayout = NO;
GSAutoLayoutEngine *engine = [self _layoutEngine];
if (!engine)
{
@ -5307,7 +5309,6 @@ static NSView* findByTag(NSView *view, NSInteger aTag, NSUInteger *level)
if (_needsLayout)
{
[self layout];
_needsLayout = NO;
}
NSArray *subviews = [self subviews];