From dff9a48319ca29beab56c85696f11770b3157bea Mon Sep 17 00:00:00 2001 From: Lars Muldjord Date: Tue, 22 Nov 2016 18:25:48 +0100 Subject: Substituted pixelColor with pixel to support older versions of Qt5 --- tools/fontgen/generator.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/fontgen/generator.cc b/tools/fontgen/generator.cc index 2ff0955..4e449f9 100644 --- a/tools/fontgen/generator.cc +++ b/tools/fontgen/generator.cc @@ -146,7 +146,7 @@ int Generator::getVertOffset(const QImage &image) { for(int y = 0; y < maxSize; ++y) { for(int x = 0; x < maxSize; ++x) { - if(image.pixelColor(x, y) != Qt::transparent) { + if(qAlpha(image.pixel(x, y)) != 0) { return y; } } @@ -158,7 +158,7 @@ int Generator::getFontHeight(const QImage &image, const int &vertOffset) { for(int y = maxSize - 1; y > vertOffset; --y) { for(int x = 0; x < maxSize; ++x) { - if(image.pixelColor(x, y) != Qt::transparent) { + if(qAlpha(image.pixel(x, y)) != 0) { return y + 1 - vertOffset; } } @@ -171,7 +171,7 @@ int Generator::getHorizOffset(const QImage &image) for(int x = 0; x < maxSize; ++x) { for(int y = 0; y < maxSize; ++y) { // Check for alpha threshold to make sure we don't get too much space between chars - if(image.pixelColor(x, y).alpha() > ALPHATHRES) { + if(qAlpha(image.pixel(x, y)) > ALPHATHRES) { return x; } } @@ -184,7 +184,7 @@ int Generator::getFontWidth(const QImage &image, const int &horizOffset) for(int x = maxSize - 1; x > horizOffset; --x) { for(int y = 0; y < maxSize; ++y) { // Check for alpha threshold to make sure we don't get too much space between chars - if(image.pixelColor(x, y).alpha() > ALPHATHRES) { + if(qAlpha(image.pixel(x, y)) > ALPHATHRES) { return x + 1 - horizOffset; } } -- cgit v1.2.3