Skip to content
This repository has been archived by the owner on Apr 25, 2018. It is now read-only.

Commit

Permalink
a view cannot be constrained to itself
Browse files Browse the repository at this point in the history
  • Loading branch information
davedelong committed Aug 15, 2010
1 parent 9c605da commit 5719aff
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions CHLayoutManager.m
Expand Up @@ -130,18 +130,12 @@ - (void) processView:(NSView *)aView {

/**
ORDER OF OPERATIONS:
1. See if this view has any direct constraints
2. See if this view has any siblings with constraints to this view
3. See if this view has any children with constraints to superview
1. See if this view has any siblings with constraints to this view
2. See if this view has any children with constraints to superview
**/

//constraints for this view:
NSArray * viewConstraints = [self constraintsOnView:aView];
for (CHLayoutConstraint * constraint in viewConstraints) {
[constraint applyToTargetView:aView];
}

//siblings constrained to this view
NSArray * superSubviews = [[aView superview] subviews];
for (NSView * subview in superSubviews) {
if (subview == aView) { continue; }
Expand All @@ -155,6 +149,7 @@ - (void) processView:(NSView *)aView {
}
}

//subviews constrained to this view
NSArray * subviews = [aView subviews];
for (NSView * subview in subviews) {
NSArray * subviewConstraints = [self constraintsOnView:subview];
Expand Down

0 comments on commit 5719aff

Please sign in to comment.