• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/WebCore-7600.1.25/platform/graphics/

Lines Matching +refs:point +refs:max

52 static inline bool isPointOnLineSegment(const FloatPoint& vertex1, const FloatPoint& vertex2, const FloatPoint& point)
54 return point.x() >= std::min(vertex1.x(), vertex2.x())
55 && point.x() <= std::max(vertex1.x(), vertex2.x())
56 && areCollinearPoints(vertex1, vertex2, point);
154 static inline float leftSide(const FloatPoint& vertex1, const FloatPoint& vertex2, const FloatPoint& point)
156 return ((point.x() - vertex1.x()) * (vertex2.y() - vertex1.y())) - ((vertex2.x() - vertex1.x()) * (point.y() - vertex1.y()));
159 bool FloatPolygon::containsEvenOdd(const FloatPoint& point) const
165 if (isPointOnLineSegment(vertex1, vertex2, point))
167 if ((vertex1.y() <= point.y() && vertex2.y() > point.y()) || (vertex1.y() > point.y() && vertex2.y() <= point.y())) {
168 float vt = (point.y() - vertex1.y()) / (vertex2.y() - vertex1.y());
169 if (point.x() < vertex1.x() + vt * (vertex2.x() - vertex1.x()))
176 bool FloatPolygon::containsNonZero(const FloatPoint& point) const
182 if (isPointOnLineSegment(vertex1, vertex2, point))
184 if (vertex2.y() < point.y()) {
185 if ((vertex1.y() > point.y()) && (leftSide(vertex1, vertex2, point) > 0))
187 } else if (vertex2.y() > point.y()) {
188 if ((vertex1.y() <= point.y()) && (leftSide(vertex1, vertex2, point) < 0))
195 bool FloatPolygon::contains(const FloatPoint& point) const
197 if (!m_boundingBox.contains(point))
199 return fillRule() == RULE_NONZERO ? containsNonZero(point) : containsEvenOdd(point);
229 bool VertexPair::intersection(const VertexPair& other, FloatPoint& point) const
231 // See: http://paulbourke.net/geometry/pointlineplane/, "Intersection point of two lines in 2 dimensions"
240 // in parametric form. Each point on the line segment is: vertex1 + u * (vertex2 - vertex1),
241 // when 0 <= u <= 1. We're computing the values of u for each line at their intersection point.
250 point = vertex1() + uThisLine * thisDelta;