OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007 Eric Seidel <eric@webkit.org> | 2 * Copyright (C) 2006, 2007 Eric Seidel <eric@webkit.org> |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 return 0; | 184 return 0; |
185 } | 185 } |
186 | 186 |
187 float PathTraversalState::lineTo(const FloatPoint& point) | 187 float PathTraversalState::lineTo(const FloatPoint& point) |
188 { | 188 { |
189 float distance = distanceLine(m_current, point); | 189 float distance = distanceLine(m_current, point); |
190 m_current = point; | 190 m_current = point; |
191 return distance; | 191 return distance; |
192 } | 192 } |
193 | 193 |
194 float PathTraversalState::quadraticBezierTo(const FloatPoint& newControl, const
FloatPoint& newEnd) | |
195 { | |
196 float distance = curveLength<QuadraticBezier>(*this, QuadraticBezier(m_curre
nt, newControl, newEnd)); | |
197 | |
198 if (m_action != TraversalPointAtLength && m_action != TraversalNormalAngleAt
Length) | |
199 m_current = newEnd; | |
200 | |
201 return distance; | |
202 } | |
203 | |
204 float PathTraversalState::cubicBezierTo(const FloatPoint& newControl1, const Flo
atPoint& newControl2, const FloatPoint& newEnd) | 194 float PathTraversalState::cubicBezierTo(const FloatPoint& newControl1, const Flo
atPoint& newControl2, const FloatPoint& newEnd) |
205 { | 195 { |
206 float distance = curveLength<CubicBezier>(*this, CubicBezier(m_current, newC
ontrol1, newControl2, newEnd)); | 196 float distance = curveLength<CubicBezier>(*this, CubicBezier(m_current, newC
ontrol1, newControl2, newEnd)); |
207 | 197 |
208 if (m_action != TraversalPointAtLength && m_action != TraversalNormalAngleAt
Length) | 198 if (m_action != TraversalPointAtLength && m_action != TraversalNormalAngleAt
Length) |
209 m_current = newEnd; | 199 m_current = newEnd; |
210 | 200 |
211 return distance; | 201 return distance; |
212 } | 202 } |
213 | 203 |
(...skipping 10 matching lines...) Expand all Loading... |
224 } else { | 214 } else { |
225 m_normalAngle = rad2deg(slope); | 215 m_normalAngle = rad2deg(slope); |
226 } | 216 } |
227 m_success = true; | 217 m_success = true; |
228 } | 218 } |
229 m_previous = m_current; | 219 m_previous = m_current; |
230 } | 220 } |
231 | 221 |
232 } // namespace blink | 222 } // namespace blink |
233 | 223 |
OLD | NEW |