Skip to content
Permalink
Browse files

Use qMax macro instead of reimplementing the same thing

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8142 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux
timlinux committed Feb 12, 2008
1 parent 438c10c commit 07b94b2b098ddc9635fb86a8049bbfedf3e34845
Showing with 1 addition and 16 deletions.
  1. +1 −13 src/core/qgspoint.cpp
  2. +0 −3 src/core/qgspoint.h
@@ -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;
@@ -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;
}
}
@@ -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

0 comments on commit 07b94b2

Please sign in to comment.
You can’t perform that action at this time.