| 983 | |
| 984 | |
| 985 | void PathObject::normalize() |
| 986 | { |
| 987 | for (MapCoordVector::size_type i = 0; i < coords.size(); ++i) |
| 988 | { |
| 989 | if (coords[i].isCurveStart()) |
| 990 | { |
| 991 | if (i+3 >= getCoordinateCount()) |
| 992 | { |
| 993 | coords[i].setCurveStart(false); |
| 994 | continue; |
| 995 | } |
| 996 | |
| 997 | if (coords[i + 1].isClosePoint() || coords[i + 1].isHolePoint() || |
| 998 | coords[i + 2].isClosePoint() || coords[i + 2].isHolePoint()) |
| 999 | { |
| 1000 | coords[i].setCurveStart(false); |
| 1001 | continue; |
| 1002 | } |
| 1003 | |
| 1004 | coords[i + 1].setCurveStart(false); |
| 1005 | coords[i + 1].setDashPoint(false); |
| 1006 | coords[i + 2].setCurveStart(false); |
| 1007 | coords[i + 2].setDashPoint(false); |
| 1008 | i += 2; |
| 1009 | } |
| 1010 | |
| 1011 | if (i > 0 && coords[i].isHolePoint()) |
| 1012 | { |
| 1013 | if (coords[i-1].isHolePoint()) |
| 1014 | deleteCoordinate(i, false); |
| 1015 | } |
| 1016 | } |
| 1017 | } |
| 1018 | |
| 1019 | bool PathObject::intersectsBox(const QRectF& box) const |
| 1020 | { |
no test coverage detected