Skip to content

Commit

Permalink
[added] needsLayout methods to widgets.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan.sweet committed Oct 17, 2011
1 parent b5a1b18 commit 1650bc0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions gdx/src/com/badlogic/gdx/scenes/scene2d/ui/Widget.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ public void validate () {
layout();
}

public boolean needsLayout () {
return needsLayout;
}

public void invalidateHierarchy () {
invalidate();
if (parent instanceof Layout) ((Layout)parent).invalidateHierarchy();
Expand Down
6 changes: 5 additions & 1 deletion gdx/src/com/badlogic/gdx/scenes/scene2d/ui/WidgetGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ public void validate () {
needsLayout = false;
}

public boolean needsLayout () {
return needsLayout;
}

public void invalidateHierarchy () {
invalidate();
if (parent instanceof Layout) ((Layout)parent).invalidateHierarchy();
}

protected void childrenChanged () {
invalidateHierarchy();
}
Expand Down

0 comments on commit 1650bc0

Please sign in to comment.