Implement smoothNeeded() - window quads need smoothing if width or height
of some of them has changed. svn path=/trunk/KDE/kdebase/workspace/; revision=689942
This commit is contained in:
parent
dbade7f1a4
commit
023ebc47b1
2 changed files with 14 additions and 1 deletions
|
@ -355,6 +355,15 @@ WindowQuad WindowQuad::makeSubQuad( float x1, float y1, float x2, float y2 ) con
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WindowQuad::smoothNeeded() const
|
||||||
|
{
|
||||||
|
// smoothing is needed if the width or height of the quad does not match the original size
|
||||||
|
float width = verts[ 1 ].ox - verts[ 0 ].ox;
|
||||||
|
float height = verts[ 2 ].oy - verts[ 1 ].oy;
|
||||||
|
return( verts[ 1 ].px - verts[ 0 ].px != width || verts[ 2 ].px - verts[ 3 ].px != width
|
||||||
|
|| verts[ 2 ].py - verts[ 1 ].py != height || verts[ 3 ].py - verts[ 0 ].py != height );
|
||||||
|
}
|
||||||
|
|
||||||
/***************************************************************
|
/***************************************************************
|
||||||
WindowQuadList
|
WindowQuadList
|
||||||
***************************************************************/
|
***************************************************************/
|
||||||
|
@ -510,7 +519,10 @@ WindowQuadList WindowQuadList::filterOut( WindowQuadType type ) const
|
||||||
|
|
||||||
bool WindowQuadList::smoothNeeded() const
|
bool WindowQuadList::smoothNeeded() const
|
||||||
{
|
{
|
||||||
return false; // TODO
|
foreach( WindowQuad q, *this )
|
||||||
|
if( q.smoothNeeded())
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -409,6 +409,7 @@ class KWIN_EXPORT WindowQuad
|
||||||
float originalRight() const;
|
float originalRight() const;
|
||||||
float originalTop() const;
|
float originalTop() const;
|
||||||
float originalBottom() const;
|
float originalBottom() const;
|
||||||
|
bool smoothNeeded() const;
|
||||||
private:
|
private:
|
||||||
friend class WindowQuadList;
|
friend class WindowQuadList;
|
||||||
void checkUntransformed() const;
|
void checkUntransformed() const;
|
||||||
|
|
Loading…
Reference in a new issue