Skip to content

Commit

Permalink
Fixed VerticalGroup align top, set default align to match old behavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanSweet committed Jun 27, 2016
1 parent 5726bbc commit d219dbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -40,7 +40,7 @@ public class HorizontalGroup extends WidgetGroup {
private boolean sizeInvalid = true;
private FloatArray rowSizes; // row width, row height, ...

private int align, rowAlign;
private int align = Align.left, rowAlign;
private boolean reverse, round = true, wrap;
private float space, wrapSpace, fill, padTop, padLeft, padBottom, padRight;

Expand Down
6 changes: 3 additions & 3 deletions gdx/src/com/badlogic/gdx/scenes/scene2d/ui/VerticalGroup.java
Expand Up @@ -40,7 +40,7 @@ public class VerticalGroup extends WidgetGroup {
private boolean sizeInvalid = true;
private FloatArray columnSizes; // column height, column width, ...

private int align, columnAlign;
private int align = Align.top, columnAlign;
private boolean reverse, round = true, wrap;
private float space, wrapSpace, fill, padTop, padLeft, padBottom, padRight;

Expand Down Expand Up @@ -137,9 +137,9 @@ public void layout () {
float space = this.space, padLeft = this.padLeft, fill = this.fill;
float columnWidth = getWidth() - padLeft - padRight, y = prefHeight - padTop + space;

if ((align & Align.right) != 0)
if ((align & Align.top) != 0)
y += getHeight() - prefHeight;
else if ((align & Align.left) == 0) // center
else if ((align & Align.bottom) == 0) // center
y += (getHeight() - prefHeight) / 2;

align = columnAlign;
Expand Down

0 comments on commit d219dbb

Please sign in to comment.