KHTML
PathTraversalState.cpp
Go to the documentation of this file.
40 return sqrtf((end.x() - start.x()) * (end.x() - start.x()) + (end.y() - start.y()) * (end.y() - start.y()));
77 CubicBezier(const FloatPoint& s, const FloatPoint& c1, const FloatPoint& c2, const FloatPoint& e)
87 return distanceLine(start, control1) + distanceLine(control1, control2) + distanceLine(control2, end);
114 // A simple speed-up would be to use an additional boolean template parameter to control whether
116 // version which does update the PathTraversalState. We'll have to shark it to see if that's necessary.
117 // Another check which is possible up-front (to send us down the fast path) would be to check if
180 float PathTraversalState::quadraticBezierTo(const FloatPoint& newControl, const FloatPoint& newEnd)
182 float distance = curveLength<QuadraticBezier>(*this, QuadraticBezier(m_current, newControl, newEnd));
193 float PathTraversalState::cubicBezierTo(const FloatPoint& newControl1, const FloatPoint& newControl2, const FloatPoint& newEnd)
195 float distance = curveLength<CubicBezier>(*this, CubicBezier(m_current, newControl1, newControl2, newEnd));
static float curveLength(PathTraversalState &traversalState, CurveType curve)
Definition: PathTraversalState.cpp:120
float moveTo(const FloatPoint &)
Definition: PathTraversalState.cpp:167
float m_desiredLength
Definition: PathTraversalState.h:67
float cubicBezierTo(const FloatPoint &newControl1, const FloatPoint &newControl2, const FloatPoint &newEnd)
Definition: PathTraversalState.cpp:193
float quadraticBezierTo(const FloatPoint &newControl, const FloatPoint &newEnd)
Definition: PathTraversalState.cpp:180
Definition: FloatPoint.h:61
static FloatPoint midPoint(const FloatPoint &first, const FloatPoint &second)
Definition: PathTraversalState.cpp:33
static const float kPathSegmentLengthTolerance
Definition: PathTraversalState.cpp:31
PathTraversalAction
Definition: PathTraversalState.h:41
float lineTo(const FloatPoint &)
Definition: PathTraversalState.cpp:173
PathTraversalState(PathTraversalAction)
Definition: PathTraversalState.cpp:150
PathTraversalAction m_action
Definition: PathTraversalState.h:57
const KShortcut & end()
static float distanceLine(const FloatPoint &start, const FloatPoint &end)
Definition: PathTraversalState.cpp:38
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:22 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:22 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.