mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 19:02:59 +00:00
replace fuzzyCompare() with its body
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
d35782f93c
commit
f4d63c777c
1 changed files with 4 additions and 9 deletions
|
@ -1449,8 +1449,8 @@ QPathClipper::QPathClipper(const QPainterPath &subject,
|
|||
bMask = clipPath.fillRule() == Qt::WindingFill ? ~0x0 : 0x1;
|
||||
}
|
||||
|
||||
template <typename Iterator, typename Equality>
|
||||
Iterator qRemoveDuplicates(Iterator begin, Iterator end, Equality eq)
|
||||
template <typename Iterator>
|
||||
Iterator qRemoveDuplicates(Iterator begin, Iterator end)
|
||||
{
|
||||
if (begin == end)
|
||||
return end;
|
||||
|
@ -1459,7 +1459,7 @@ Iterator qRemoveDuplicates(Iterator begin, Iterator end, Equality eq)
|
|||
++begin;
|
||||
Iterator insert = begin;
|
||||
for (Iterator it = begin; it != end; ++it) {
|
||||
if (!eq(*it, *last)) {
|
||||
if (!qFuzzyCompare(*it, *last)) {
|
||||
*insert++ = *it;
|
||||
last = it;
|
||||
}
|
||||
|
@ -1493,11 +1493,6 @@ InputIterator qFuzzyFind(InputIterator first, InputIterator last, qreal val)
|
|||
return first;
|
||||
}
|
||||
|
||||
static bool fuzzyCompare(qreal a, qreal b)
|
||||
{
|
||||
return qFuzzyCompare(a, b);
|
||||
}
|
||||
|
||||
bool QPathClipper::pathToRect(const QPainterPath &path, QRectF *rect)
|
||||
{
|
||||
if (path.elementCount() != 5)
|
||||
|
@ -1633,7 +1628,7 @@ bool QPathClipper::doClip(QWingedEdge &list) const
|
|||
y_coords << list.vertex(i)->y;
|
||||
|
||||
qSort(y_coords.begin(), y_coords.end());
|
||||
y_coords.resize(qRemoveDuplicates(y_coords.begin(), y_coords.end(), fuzzyCompare) - y_coords.begin());
|
||||
y_coords.resize(qRemoveDuplicates(y_coords.begin(), y_coords.end()) - y_coords.begin());
|
||||
|
||||
#ifdef QDEBUG_CLIPPER
|
||||
printf("sorted y coords:\n");
|
||||
|
|
Loading…
Add table
Reference in a new issue