From e051b75b4fc19eacd2334404f44f16ddddf2e3a5 Mon Sep 17 00:00:00 2001 From: Aloshi Date: Fri, 16 May 2014 15:58:17 -0500 Subject: [PATCH] Fix +/- 1px uneven line spacing in textlists. Center selector bar on selected row when selector bar height does not match row height. --- src/components/TextListComponent.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/TextListComponent.h b/src/components/TextListComponent.h index 34e2c8f2d..05d569f1d 100644 --- a/src/components/TextListComponent.h +++ b/src/components/TextListComponent.h @@ -135,7 +135,7 @@ void TextListComponent::render(const Eigen::Affine3f& parentTrans) if(size() == 0) return; - const float entrySize = font->getHeight(mLineSpacing); + const float entrySize = round(font->getHeight(mLineSpacing)); int startEntry = 0; @@ -161,7 +161,7 @@ void TextListComponent::render(const Eigen::Affine3f& parentTrans) if(startEntry < listCutoff) { Renderer::setMatrix(trans); - Renderer::drawRect(0.f, (mCursor - startEntry)*entrySize, mSize.x(), font->getHeight(), mSelectorColor); + Renderer::drawRect(0.f, (mCursor - startEntry)*entrySize + (entrySize - font->getHeight())/2, mSize.x(), font->getHeight(), mSelectorColor); } // clip to inside margins