summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/utils/utils.cpp
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2014-01-22 10:00:08 +0200
committerTomi Korpipää <tomi.korpipaa@digia.com>2014-01-22 10:15:56 +0200
commit892bd7976b2980947adf216b8afc5c6f2a63ce65 (patch)
treef38a25d0ebffd164b713860d8ed6b3f365398280 /src/datavisualization/utils/utils.cpp
parent072b7614c6b1a1f32a4baebb8260866d72ee9299 (diff)
Made jira tasks of TODOs, part 2
+ commented-out code and qDebugs removed Task-number: QTRD-2398 Change-Id: Iab13e3ae9d672c0a3bcb4735b3fd1931b2eb7d86 Change-Id: Iab13e3ae9d672c0a3bcb4735b3fd1931b2eb7d86 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'src/datavisualization/utils/utils.cpp')
-rw-r--r--src/datavisualization/utils/utils.cpp22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/datavisualization/utils/utils.cpp b/src/datavisualization/utils/utils.cpp
index 30291963..78978c3c 100644
--- a/src/datavisualization/utils/utils.cpp
+++ b/src/datavisualization/utils/utils.cpp
@@ -74,10 +74,8 @@ QImage Utils::printTextToImage(const QFont &font, const QString &text, const QCo
if (maxLabelWidth)
valueStrWidth = maxLabelWidth + paddingWidth / 2;
labelSize = QSize(valueStrWidth + prePadding, valueStrHeight + prePadding);
- //qDebug() << "label size before padding" << text << labelSize;
labelSize.setWidth(getNearestPowerOfTwo(labelSize.width(), paddingWidth));
labelSize.setHeight(getNearestPowerOfTwo(labelSize.height(), paddingHeight));
- //qDebug() << "label size after padding" << labelSize << paddingWidth << paddingHeight;
#else
if (!labelBackground)
labelSize = QSize(valueStrWidth, valueStrHeight);
@@ -131,30 +129,12 @@ QImage Utils::printTextToImage(const QFont &font, const QString &text, const QCo
QVector3D Utils::getSelection(QPoint mousepos, int height)
{
- //#if defined(QT_OPENGL_ES_2)
- // This is the only one that works with ANGLE (ES 2.0)
+ // This is the only one that works with OpenGL ES 2.0, so we're forced to use it
// Item count will be limited to 256*256*256
GLubyte pixel[4] = {255, 255, 255, 0};
glReadPixels(mousepos.x(), height - mousepos.y(), 1, 1, GL_RGBA, GL_UNSIGNED_BYTE,
(void *)pixel);
-
- //qDebug() << "rgba" << pixel[0] << pixel[1] << pixel[2] << pixel[3] << "mousepos:" << mousepos << "height:" << height;
-
- //#else
- // These work with desktop OpenGL
- // They offer a lot higher possible object count and a possibility to use object ids
- //GLuint pixel[3];
- //glReadPixels(mousepos.x(), height - mousepos.y(), 1, 1,
- // GL_RGB, GL_UNSIGNED_INT, (void *)pixel);
- //qDebug() << "rgba" << pixel[0] << pixel[1] << pixel[2];// << pixel[3];
-
- //GLfloat pixel3[3];
- //glReadPixels(mousepos.x(), height - mousepos.y(), 1, 1,
- // GL_RGB, GL_FLOAT, (void *)pixel3);
- //qDebug() << "rgba" << pixel3[0] << pixel3[1] << pixel3[2];// << pixel[3];
- //#endif
QVector3D selectedColor(pixel[0], pixel[1], pixel[2]);
- //qDebug() << selectedColor;
return selectedColor;
}