Yet another text path algorithm fix

Floor the font sizes
This commit is contained in:
Martin Tůma 2018-11-06 23:51:44 +01:00
parent c97f2235a9
commit d7aa49b7ea
2 changed files with 4 additions and 2 deletions

View File

@ -322,7 +322,7 @@ Style::Layer::Layout::Layout(const QJsonObject &json)
QFont Style::Layer::Layout::font(int zoom) const
{
QFont font(_font);
font.setPixelSize(qRound(_textSize.value(zoom)));
font.setPixelSize(_textSize.value(zoom));
return font;
}

View File

@ -122,7 +122,9 @@ static QPainterPath textPath(const QPainterPath &path, qreal textWidth,
angle = a;
}
return QPainterPath();
return (length > textWidth)
? subpath(lines, last, lines.size() - 1, length - textWidth)
: QPainterPath();
}
static bool reverse(const QPainterPath &path)