add a function that returns the center of a given normalized rect

svn path=/trunk/KDE/kdegraphics/okular/; revision=1048191
remotes/origin/KDE/4.4
Albert Astals Cid 17 years ago
parent 4041eb7f5b
commit 81d255bafb
  1. 5
      core/area.cpp
  2. 6
      core/area.h

@ -158,6 +158,11 @@ bool NormalizedRect::operator==( const NormalizedRect & r ) const
fabs( bottom - r.bottom ) < 1e-4 );
}
NormalizedPoint NormalizedRect::center() const
{
return NormalizedPoint((left+right)/2.0, (top+bottom)/2.0);
}
/*
QDebug operator << (QDebug str , const NormalizedRect &r)
{

@ -191,6 +191,12 @@ class OKULAR_EXPORT NormalizedRect
*/
bool operator==( const NormalizedRect &other ) const;
/**
* Returns the center of the rectangle
* @since 0.10 (KDE 4.4)
*/
NormalizedPoint center() const;
/**
* Transforms the normalized rectangle with the operations defined by @p matrix.
*/

Loading…
Cancel
Save