From 73b0741d2aad38a5e7e880a3731f68a320aab280 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 9 Oct 2014 14:48:19 +0300 Subject: If GL_MAX_TEXTURE_SIZE cannot be read, don't check for it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Tomi Korpipää --- src/datavisualization/utils/utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/datavisualization/utils') 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) { -- cgit v1.2.3