mirror of
https://github.com/tumic0/QtPBFImagePlugin.git
synced 2025-02-20 18:10:49 +01:00
Compare commits
3 Commits
08d211204e
...
cb4919d5bd
Author | SHA1 | Date | |
---|---|---|---|
cb4919d5bd | |||
affb818f4e | |||
851ed76e26 |
@ -1,4 +1,4 @@
|
||||
version: 4.0.{build}
|
||||
version: 4.1.{build}
|
||||
|
||||
configuration:
|
||||
- Release
|
||||
|
@ -2,7 +2,7 @@ TARGET = pbf
|
||||
TEMPLATE = lib
|
||||
CONFIG += plugin
|
||||
QT += gui
|
||||
VERSION = 4.0
|
||||
VERSION = 4.1
|
||||
|
||||
HEADERS += src/pbfhandler.h \
|
||||
src/data.h \
|
||||
|
@ -11,7 +11,7 @@
|
||||
struct CTX
|
||||
{
|
||||
CTX(const QByteArray &ba)
|
||||
: bp(ba.constData()), be(bp + ba.size()) {}
|
||||
: bp(ba.constData()), be(bp + ba.size()), tag(0) {}
|
||||
|
||||
const char *bp;
|
||||
const char *be;
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <QColor>
|
||||
#include <QPair>
|
||||
#include <QString>
|
||||
#include <QJsonValue>
|
||||
|
||||
class QJsonObject;
|
||||
|
||||
|
@ -22,6 +22,7 @@ static QImage sdf2img(const QImage &sdf, const QColor &color)
|
||||
}
|
||||
|
||||
Sprites::Sprite::Sprite(const QJsonObject &json)
|
||||
: _pixelRatio(1.0), _sdf(false)
|
||||
{
|
||||
int x, y, width, height;
|
||||
|
||||
@ -44,16 +45,10 @@ Sprites::Sprite::Sprite(const QJsonObject &json)
|
||||
|
||||
_rect = QRect(x, y, width, height);
|
||||
|
||||
|
||||
if (json.contains("pixelRatio") && json["pixelRatio"].isDouble())
|
||||
_pixelRatio = json["pixelRatio"].toDouble();
|
||||
else
|
||||
_pixelRatio = 1.0;
|
||||
|
||||
if (json.contains("sdf") && json["sdf"].isBool())
|
||||
_sdf = json["sdf"].toBool();
|
||||
else
|
||||
_sdf = false;
|
||||
}
|
||||
|
||||
bool Sprites::load(const QString &jsonFile, const QString &imageFile)
|
||||
|
Loading…
x
Reference in New Issue
Block a user