Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use qMax macro instead of reimplementing the same thing
git-svn-id: http://svn.osgeo.org/qgis/trunk@8142 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Feb 12, 2008
1 parent 4fee6d8 commit 3c1b2f7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
14 changes: 1 addition & 13 deletions src/core/qgspoint.cpp
Expand Up @@ -99,7 +99,7 @@ int QgsPoint::onSegment(const QgsPoint& a, const QgsPoint& b) const
//algorithm from 'graphics GEMS', A. Paeth: 'A Fast 2D Point-on-line test'
if(
fabs( (b.y() - a.y()) * (m_x - a.x()) - (m_y - a.y()) * (b.x() - a.x())) \
>= maxValue( fabs(b.x() - a.x()), fabs(b.y() - a.y()))
>= qMax( fabs(b.x() - a.x()), fabs(b.y() - a.y()))
)
{
return 0;
Expand All @@ -123,15 +123,3 @@ int QgsPoint::onSegment(const QgsPoint& a, const QgsPoint& b) const

return 2;
}

double QgsPoint::maxValue(double a, double b) const
{
if(b > a)
{
return b;
}
else
{
return a;
}
}
3 changes: 0 additions & 3 deletions src/core/qgspoint.h
Expand Up @@ -127,9 +127,6 @@ class CORE_EXPORT QgsPoint
//! y coordinate
double m_y;

//! little helper function that returns the maximum of
//! two doubles (or a in case of equality)
double maxValue(double a, double b) const;

}; // class QgsPOint

Expand Down

0 comments on commit 3c1b2f7

Please sign in to comment.