3 Commits
4.3 ... master

Author SHA1 Message Date
ee4c0120a2 Added support for scaling non-sdf icons 2025-07-18 18:12:29 +02:00
6f4f25afa3 Improve text-anchor values mapping 2025-07-18 18:10:50 +02:00
d32da083d6 Version++ 2025-07-18 18:10:24 +02:00
5 changed files with 16 additions and 8 deletions

View File

@ -1,4 +1,4 @@
version: 4.3.{build}
version: 4.4.{build}
configuration:
- Release

View File

@ -2,7 +2,7 @@ TARGET = pbf
TEMPLATE = lib
CONFIG += plugin
QT += gui
VERSION = 4.3
VERSION = 4.4
HEADERS += src/pbfhandler.h \
src/data.h \

View File

@ -123,8 +123,15 @@ QImage Sprites::sprite(const Sprite &sprite, const QColor &color, qreal scale)
return sdf2img(simg, color);
} else
return sdf2img(img, color);
} else
return img;
} else {
if (scale != 1.0) {
QSize size(img.size().width() * scale, img.size().height() * scale);
QImage simg(img.scaled(size, Qt::IgnoreAspectRatio,
Qt::SmoothTransformation));
return simg;
} else
return img;
}
}
QImage Sprites::icon(const QString &name, const QColor &color, qreal size)

View File

@ -415,9 +415,10 @@ Text::Anchor Style::Layer::Layout::textAnchor(int zoom) const
{
QString anchor(_textAnchor.value(zoom));
if (anchor == "left")
if (anchor == "left" || anchor == "top-left" || anchor == "bottom-left")
return Text::Left;
else if (anchor == "right")
else if (anchor == "right" || anchor == "top-right"
|| anchor == "bottom-right")
return Text::Right;
else if (anchor == "top")
return Text::Top;

View File

@ -91,8 +91,8 @@ private:
class Layout {
public:
Layout() : _textSize(16), _textMaxWidth(10), _textMaxAngle(45),
_font("Open Sans"), _visible(true) {}
Layout() : _iconSize(1.0), _textSize(16), _textMaxWidth(10),
_textMaxAngle(45), _font("Open Sans"), _visible(true) {}
Layout(const QJsonObject &json);
qreal maxTextWidth(int zoom) const