mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 22:25:38 +00:00
Fix +/- 1px uneven line spacing in textlists.
Center selector bar on selected row when selector bar height does not match row height.
This commit is contained in:
parent
90cc0991a3
commit
e051b75b4f
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue