public void layout () {
		if (sizeInvalid) {
			computeSize();
			if (lastPrefWidth != prefWidth) {
				lastPrefWidth = prefWidth;
				invalidateHierarchy();
			}
		}
		SnapshotArray<Actor> children = getChildren();
		float groupHeight = getHeight();
		float x = 0;
		float y = getHeight();
		float maxWidth = 0;
		for (int i = 0, n = children.size; i < n; i++) {
			Actor child = children.get(i);
			float width = child.getWidth();
			float height = child.getHeight();
			if (child instanceof Layout) {
				Layout layout = (Layout) child;
				width = layout.getPrefWidth();
				height = layout.getPrefHeight();
			}
			if (y - height >= 0) {				
				maxWidth = Math.max(width, maxWidth);
			} else {
				x += maxWidth + spacing;
				maxWidth = width;
				y = groupHeight;
			}
			child.setBounds(x, y - height, width, height);
			y -= height + spacing;
		}
	}