Fix size of challenge items

This commit is contained in:
drdev
2014-08-05 02:52:42 +00:00
parent 4d3796d8a7
commit 037a38e99b

View File

@@ -134,15 +134,14 @@ class QuestEventPanel extends FDisplayObject {
@Override @Override
protected ScrollBounds layoutAndGetScrollBounds(float visibleWidth, float visibleHeight) { protected ScrollBounds layoutAndGetScrollBounds(float visibleWidth, float visibleHeight) {
int panelCount = getChildCount(); if (getChildCount() == 0) {
if (panelCount == 0) {
return new ScrollBounds(visibleWidth, visibleHeight); return new ScrollBounds(visibleWidth, visibleHeight);
} }
float y = 0; float y = 0;
float panelWidth = visibleWidth; float panelWidth = visibleWidth;
float padding = 2 * PADDING; //use twice as much padding between panels float padding = 2 * PADDING; //use twice as much padding between panels
float panelHeight = (visibleHeight + padding) / panelCount - padding; float panelHeight = (visibleHeight + padding) / 3 - padding;
if (panelHeight < MIN_HEIGHT) { if (panelHeight < MIN_HEIGHT) {
panelHeight = MIN_HEIGHT; panelHeight = MIN_HEIGHT;
} }