Merge pull request #338 from gnustep/fix_needsLayout

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 2025-03-05 15:50:43 +01:00 committed by GitHub
commit d7b54f7a76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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];