Fixed missing bottom spacer on ComponentLists.

This commit is contained in:
Aloshi 2014-05-21 16:33:10 -05:00
parent 7f62b06d1a
commit 9aaa5e79d9
2 changed files with 5 additions and 4 deletions

View file

@ -162,7 +162,7 @@ void ComponentList::render(const Eigen::Affine3f& parentTrans)
Eigen::Vector3f dim(mSize.x(), mSize.y(), 0); Eigen::Vector3f dim(mSize.x(), mSize.y(), 0);
dim = trans * dim - trans.translation(); dim = trans * dim - trans.translation();
Renderer::pushClipRect(Eigen::Vector2i((int)trans.translation().x(), (int)trans.translation().y()), Renderer::pushClipRect(Eigen::Vector2i((int)trans.translation().x(), (int)trans.translation().y()),
Eigen::Vector2i((int)round(dim.x()), (int)round(dim.y()))); Eigen::Vector2i((int)round(dim.x()), (int)round(dim.y() + 1)));
// scroll the camera // scroll the camera
trans.translate(Eigen::Vector3f(0, -round(mCameraOffset), 0)); trans.translate(Eigen::Vector3f(0, -round(mCameraOffset), 0));

View file

@ -50,16 +50,17 @@ void MenuComponent::updateSize()
float height = TITLE_HEIGHT + mList->getTotalRowHeight() + getButtonGridHeight() + 2; float height = TITLE_HEIGHT + mList->getTotalRowHeight() + getButtonGridHeight() + 2;
if(height > maxHeight) if(height > maxHeight)
{ {
height = TITLE_HEIGHT + getButtonGridHeight() + 2; height = TITLE_HEIGHT + getButtonGridHeight();
int i = 0; int i = 0;
while(height < maxHeight && i < mList->size()) while(i < mList->size())
{ {
float rowHeight = mList->getRowHeight(i); float rowHeight = mList->getRowHeight(i);
if(height + rowHeight < maxHeight) if(height + rowHeight < maxHeight)
height += rowHeight; height += rowHeight;
else
break;
i++; i++;
} }
height += 2;
} }
setSize(Renderer::getScreenWidth() * 0.5f, height); setSize(Renderer::getScreenWidth() * 0.5f, height);