diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-10-09 14:48:19 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@theqtcompany.com> | 2014-10-10 10:32:45 +0300 |
commit | 73b0741d2aad38a5e7e880a3731f68a320aab280 (patch) | |
tree | 4af77f3cbe62824ca7e0808c2ae5f5a9e113dc8b /src | |
parent | 93204b3bda941f1b36042fad46753c3f3219a082 (diff) |
If GL_MAX_TEXTURE_SIZE cannot be read, don't check for it
In QML apps, the texture for custom labels can get created before
glGenIntegerv returns a valid value for GL_MAX_TEXTURE_SIZE.
Do not check for max size when it is zero.
Change-Id: I114ac8494bd5aa509490bd38ae58827fd21e2729
Reviewed-by: Mika Salmela <mika.salmela@digia.com>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/datavisualization/utils/utils.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/datavisualization/utils/utils.cpp b/src/datavisualization/utils/utils.cpp index d588ee16..2767451e 100644 --- a/src/datavisualization/utils/utils.cpp +++ b/src/datavisualization/utils/utils.cpp @@ -94,7 +94,7 @@ QImage Utils::printTextToImage(const QFont &font, const QString &text, const QCo else labelSize = QSize(valueStrWidth + paddingWidth * 2, valueStrHeight + paddingHeight * 2); #endif - if (labelSize.width() <= maxTextureSize) { + if (!maxTextureSize || labelSize.width() <= maxTextureSize) { // Make sure the label is not too wide sizeOk = true; } else if (--currentFontSize == 4) { |