Commit e051b75b authored by Aloshi's avatar Aloshi

Fix +/- 1px uneven line spacing in textlists.

Center selector bar on selected row when selector bar height does not match row height.
parent 90cc0991
......@@ -135,7 +135,7 @@ void TextListComponent<T>::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<T>::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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment