From 9aaa5e79d93bef747aa532550b49ee71161ee7e4 Mon Sep 17 00:00:00 2001 From: Aloshi Date: Wed, 21 May 2014 16:33:10 -0500 Subject: [PATCH] Fixed missing bottom spacer on ComponentLists. --- src/components/ComponentList.cpp | 2 +- src/components/MenuComponent.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/ComponentList.cpp b/src/components/ComponentList.cpp index 9a2d1c1dd..73aa9961a 100644 --- a/src/components/ComponentList.cpp +++ b/src/components/ComponentList.cpp @@ -162,7 +162,7 @@ void ComponentList::render(const Eigen::Affine3f& parentTrans) Eigen::Vector3f dim(mSize.x(), mSize.y(), 0); dim = trans * dim - trans.translation(); 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 trans.translate(Eigen::Vector3f(0, -round(mCameraOffset), 0)); diff --git a/src/components/MenuComponent.cpp b/src/components/MenuComponent.cpp index 6094547c4..443b847b1 100644 --- a/src/components/MenuComponent.cpp +++ b/src/components/MenuComponent.cpp @@ -50,16 +50,17 @@ void MenuComponent::updateSize() float height = TITLE_HEIGHT + mList->getTotalRowHeight() + getButtonGridHeight() + 2; if(height > maxHeight) { - height = TITLE_HEIGHT + getButtonGridHeight() + 2; + height = TITLE_HEIGHT + getButtonGridHeight(); int i = 0; - while(height < maxHeight && i < mList->size()) + while(i < mList->size()) { float rowHeight = mList->getRowHeight(i); if(height + rowHeight < maxHeight) height += rowHeight; + else + break; i++; } - height += 2; } setSize(Renderer::getScreenWidth() * 0.5f, height);