Make sure gridUnit is always an even number
This prevents subpixel alignment when gridUnit / 2 is used, which is quite common.
This commit is contained in:
parent
2ba1a0c90f
commit
511495caad
@ -167,7 +167,10 @@ int Units::gridUnit() const
|
||||
|
||||
void Units::themeChanged()
|
||||
{
|
||||
const int gridUnit = QFontMetrics(QGuiApplication::font()).boundingRect("M").height();
|
||||
int gridUnit = QFontMetrics(QGuiApplication::font()).boundingRect("M").height();
|
||||
if (gridUnit % 2 != 0) {
|
||||
gridUnit++;
|
||||
}
|
||||
if (gridUnit != m_gridUnit) {
|
||||
m_gridUnit = gridUnit;
|
||||
emit gridUnitChanged();
|
||||
|
Loading…
Reference in New Issue
Block a user