summaryrefslogtreecommitdiff
path: root/layoutgl
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-08-18 01:09:36 +0200
committerTreeki <treeki@gmail.com>2012-08-18 01:09:36 +0200
commit3e0523101382ad5730086e3b031303a7a68b01d6 (patch)
tree730d5a6f665f91526be034c79a43ddb8a6558796 /layoutgl
parent18efce00580c8e9d15c8bebbf00eca1ff2e5e971 (diff)
downloadLayoutStudio-3e0523101382ad5730086e3b031303a7a68b01d6.tar.gz
LayoutStudio-3e0523101382ad5730086e3b031303a7a68b01d6.zip
giving the renderer a tiny bit more accuracy
Diffstat (limited to 'layoutgl')
-rw-r--r--layoutgl/widget.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/layoutgl/widget.cpp b/layoutgl/widget.cpp
index d4d124c..1f10558 100644
--- a/layoutgl/widget.cpp
+++ b/layoutgl/widget.cpp
@@ -101,6 +101,9 @@ void LGLWidget::paintGL() {
}
void LGLWidget::renderPane(const LYTPane *pane) {
+ if (!pane->visible)
+ return;
+
glPushMatrix();
glScalef(pane->xScale, pane->yScale, 1.0f);
@@ -441,7 +444,7 @@ void LGLWidget::drawQuad(float x, float y, float w, float h, const QVector<LYTTe
void LGLWidget::drawQuad(float x, float y, float w, float h, int texCoordCount, const LYTTexCoords *texCoords, const QColor *colours, uchar alpha) {
if (!colours)
- glColor4ub(255, 255, 255, 255);
+ glColor4ub(255, 255, 255, alpha);
glBegin(GL_QUADS);
@@ -449,28 +452,28 @@ void LGLWidget::drawQuad(float x, float y, float w, float h, int texCoordCount,
glMultiTexCoord2f(GL_TEXTURE0_ARB+i, texCoords[i].coord[0].x(), 1.0f-texCoords[i].coord[0].y());
if (colours)
- qglColor(colours[0]);
+ glColor4ub(colours[0].red(), colours[0].green(), colours[0].blue(), (colours[0].alpha() * alpha) / 255);
glVertex2f(x, y);
for (int i = 0; i < texCoordCount; i++)
glMultiTexCoord2f(GL_TEXTURE0_ARB+i, texCoords[i].coord[1].x(), 1.0f-texCoords[i].coord[1].y());
if (colours)
- qglColor(colours[1]);
+ glColor4ub(colours[1].red(), colours[1].green(), colours[1].blue(), (colours[1].alpha() * alpha) / 255);
glVertex2f(x + w, y);
for (int i = 0; i < texCoordCount; i++)
glMultiTexCoord2f(GL_TEXTURE0_ARB+i, texCoords[i].coord[3].x(), 1.0f-texCoords[i].coord[3].y());
if (colours)
- qglColor(colours[2]);
+ glColor4ub(colours[2].red(), colours[2].green(), colours[2].blue(), (colours[2].alpha() * alpha) / 255);
glVertex2f(x + w, y - h);
for (int i = 0; i < texCoordCount; i++)
glMultiTexCoord2f(GL_TEXTURE0_ARB+i, texCoords[i].coord[2].x(), 1.0f-texCoords[i].coord[2].y());
if (colours)
- qglColor(colours[3]);
+ glColor4ub(colours[3].red(), colours[3].green(), colours[3].blue(), (colours[3].alpha() * alpha) / 255);
glVertex2f(x, y - h);
glEnd();