diff options
author | Yoann Lopes <yoann.lopes@nokia.com> | 2011-01-06 14:41:42 +0100 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@nokia.com> | 2011-01-06 14:41:42 +0100 |
commit | 2486f22d386e619d9e780b8cebd77fb6931cdad8 (patch) | |
tree | 3cd3f0226cf0450e75f4b965239d3a1b60c41cc3 | |
parent | 4904941ebc3ac782b8398ecf1a56839e433a6763 (diff) |
Distfieldgen: fixes output png size.
-rw-r--r-- | tools/distfieldgen/main.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/distfieldgen/main.cpp b/tools/distfieldgen/main.cpp index 84723ec..bb62a3c 100644 --- a/tools/distfieldgen/main.cpp +++ b/tools/distfieldgen/main.cpp @@ -195,7 +195,11 @@ int main(int argc, char *argv[]) printProgress(0); // Combine dist fields in one image - QImage output(1024, 96, QImage::Format_ARGB32_Premultiplied); + int totalWidth = 0; + foreach (const QImage &df, distfields.values()) + totalWidth += df.width() > 0 ? df.width() : outSize; + + QImage output(1024, (totalWidth / 1024 + 1) * outSize, QImage::Format_ARGB32_Premultiplied); output.fill(Qt::transparent); int combinedWidth = 0; i = 0; |