diff --git a/effects/demo_wavywindows.cpp b/effects/demo_wavywindows.cpp index 774af8f3f3..54de587120 100644 --- a/effects/demo_wavywindows.cpp +++ b/effects/demo_wavywindows.cpp @@ -66,8 +66,8 @@ void WavyWindowsEffect::paintWindow( EffectWindow* w, int mask, QRegion region, ++j ) { WindowVertex& v = data.quads[ i ][ j ]; - v.move( v.x() + sin(mTimeElapsed + v.textureY() / 60 + 0.5f) * 10, - v.y() + sin(mTimeElapsed + v.textureX() / 80) * 10 ); + v.move( v.x() + sin(mTimeElapsed + v.originalY() / 60 + 0.5f) * 10, + v.y() + sin(mTimeElapsed + v.originalX() / 80) * 10 ); } } diff --git a/lib/kwineffects.cpp b/lib/kwineffects.cpp index 29d0bb6eea..494892abdf 100644 --- a/lib/kwineffects.cpp +++ b/lib/kwineffects.cpp @@ -452,8 +452,8 @@ void WindowQuadList::makeArrays( float** vertices, float** texcoords ) const { *vpos++ = at( i )[ j ].x(); *vpos++ = at( i )[ j ].y(); - *tpos++ = at( i )[ j ].textureX(); - *tpos++ = at( i )[ j ].textureY(); + *tpos++ = at( i )[ j ].tx; + *tpos++ = at( i )[ j ].ty; } } diff --git a/lib/kwineffects.h b/lib/kwineffects.h index 85b0b7dcd4..d10440c0da 100644 --- a/lib/kwineffects.h +++ b/lib/kwineffects.h @@ -368,13 +368,15 @@ class KWIN_EXPORT WindowVertex void move( float x, float y ); void setX( float x ); void setY( float y ); - float textureX() const; - float textureY() const; + float originalX() const; + float originalY() const; WindowVertex(); WindowVertex( float x, float y, float tx, float ty ); private: friend class WindowQuad; + friend class WindowQuadList; float px, py; // position + float ox, oy; // origional position float tx, ty; // texture coords }; @@ -507,7 +509,7 @@ WindowVertex::WindowVertex() inline WindowVertex::WindowVertex( float _x, float _y, float _tx, float _ty ) - : px( _x ), py( _y ), tx( _tx ), ty( _ty ) + : px( _x ), py( _y ), ox( _x ), oy( _y ), tx( _tx ), ty( _ty ) { } @@ -523,6 +525,18 @@ float WindowVertex::y() const return py; } +inline +float WindowVertex::originalX() const + { + return ox; + } + +inline +float WindowVertex::originalY() const + { + return oy; + } + inline void WindowVertex::move( float x, float y ) { @@ -542,18 +556,6 @@ void WindowVertex::setY( float y ) py = y; } -inline -float WindowVertex::textureX() const - { - return tx; - } - -inline -float WindowVertex::textureY() const - { - return ty; - } - /*************************************************************** WindowQuad ***************************************************************/ @@ -590,8 +592,6 @@ void WindowQuad::checkUntransformed() const { assert( verts[ 0 ].py == verts[ 1 ].py && verts[ 2 ].py == verts[ 3 ].py && verts[ 0 ].px == verts[ 3 ].px && verts[ 1 ].px == verts[ 2 ].px ); - assert( verts[ 0 ].ty == verts[ 1 ].ty && verts[ 2 ].ty == verts[ 3 ].ty - && verts[ 0 ].tx == verts[ 3 ].tx && verts[ 1 ].tx == verts[ 2 ].tx ); } inline