summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-04-27 07:59:31 +0000
committerSam Spilsbury <smspillaz@gmail.com>2010-04-27 07:59:31 +0000
commit6278e83b510ff354bb828f96083a1d228f41b2c5 (patch)
tree6a85d63eab975f6cea59ce713d1eb74f47ad40ab
parent32b17f6b72ba21021db31da4af1622d1dd2b3ec4 (diff)
downloadstackswitch-6278e83b510ff354bb828f96083a1d228f41b2c5.tar.gz
stackswitch-6278e83b510ff354bb828f96083a1d228f41b2c5.tar.bz2
Fix title text not placed on window
-rw-r--r--src/stackswitch.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/stackswitch.cpp b/src/stackswitch.cpp
index 565a82e..57c6d08 100644
--- a/src/stackswitch.cpp
+++ b/src/stackswitch.cpp
@@ -139,7 +139,6 @@ StackswitchScreen::drawWindowTitle (GLMatrix &transform,
float x, y, tx, ix, width, height;
int ox1, ox2, oy1, oy2;
GLTexture::Matrix m;
- GLVector vec;
GLTexture *icon;
STACKSWITCH_WINDOW (w);
@@ -177,11 +176,11 @@ StackswitchScreen::drawWindowTitle (GLMatrix &transform,
wTransform.translate (-w->x (), -w->y (), 0.0f);
mvp = pm * wTransform;
- vec = mvp * vec;
- vec.homogenize ();
+ v = mvp * v;
+ v.homogenize ();
- x = (vec[GLVector::x] + 1.0) * (ox2 - ox1) * 0.5;
- y = (vec[GLVector::y] - 1.0) * (oy2 - oy1) * -0.5;
+ x = (v[GLVector::x] + 1.0) * (ox2 - ox1) * 0.5;
+ y = (v[GLVector::y] - 1.0) * (oy2 - oy1) * -0.5;
x += ox1;
y += oy1;
@@ -227,6 +226,9 @@ StackswitchScreen::drawWindowTitle (GLMatrix &transform,
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glColor4f (1.0, 1.0, 1.0, 1.0);
+ glPushMatrix ();
+ glLoadMatrixf (wTransform.getMatrix ());
+
icon = sw->gWindow->getIcon (96, 96);
if (!icon)
icon = gScreen->defaultIcon ();
@@ -280,6 +282,8 @@ StackswitchScreen::drawWindowTitle (GLMatrix &transform,
mText.draw (x - mText.getWidth () / 2, y, 1.0);
+ glPopMatrix ();
+
glColor4usv (defaultColor);
if (!wasBlend)