Lines Matching defs:startAngle

136 float adjustEndAngle(float startAngle, float endAngle, bool anticlockwise)
141 * If the anticlockwise argument is false and endAngle-startAngle is equal to or greater than 2pi, or,
142 * if the anticlockwise argument is true and startAngle-endAngle is equal to or greater than 2pi,
143 * then the arc is the whole circumference of this ellipse, and the point at startAngle along this circle's circumference,
146 if (!anticlockwise && endAngle - startAngle >= twoPi)
147 newEndAngle = startAngle + twoPi;
148 else if (anticlockwise && startAngle - endAngle >= twoPi)
149 newEndAngle = startAngle - twoPi;
157 /* NOTE: When startAngle = 0, endAngle = 2Pi and anticlockwise = true, the spec does not indicate clearly.
161 else if (!anticlockwise && startAngle > endAngle)
162 newEndAngle = startAngle + (twoPi - fmodf(startAngle - endAngle, twoPi));
163 else if (anticlockwise && startAngle < endAngle)
164 newEndAngle = startAngle - (twoPi - fmodf(endAngle - startAngle, twoPi));
166 ASSERT(ellipseIsRenderable(startAngle, newEndAngle));
180 void canonicalizeAngle(float* startAngle, float* endAngle)
182 // Make 0 <= startAngle < 2*PI
184 float newStartAngle = *startAngle;
190 float delta = newStartAngle - *startAngle;
191 *startAngle = newStartAngle;
225 * NOTE: Before ellipse() calls this function, adjustEndAngle() is called, so endAngle - startAngle must be equal to or less than 2Pi.
227 void degenerateEllipse(CanvasPathMethods* path, float x, float y, float radiusX, float radiusY, float rotation, float startAngle, float endAngle, bool anticlockwise)
229 ASSERT(ellipseIsRenderable(startAngle, endAngle));
230 ASSERT(startAngle >= 0 && startAngle < 2 * piFloat);
231 ASSERT((anticlockwise && (startAngle - endAngle) >= 0) || (!anticlockwise && (endAngle - startAngle) >= 0));
237 lineToFloatPoint(path, center + rotationMatrix.mapPoint(getPointOnEllipse(radiusX, radiusY, startAngle)));
238 if ((!radiusX && !radiusY) || startAngle == endAngle)
243 // startAngle - fmodf(startAngle, halfPiFloat) + halfPiFloat is the one of (0, 0.5Pi, Pi, 1.5Pi, 2Pi)
244 // that is the closest to startAngle on the clockwise direction.
245 for (float angle = startAngle - fmodf(startAngle, halfPiFloat) + halfPiFloat; angle < endAngle; angle += halfPiFloat)
248 for (float angle = startAngle - fmodf(startAngle, halfPiFloat); angle > endAngle; angle -= halfPiFloat)
257 void CanvasPathMethods::arc(float x, float y, float radius, float startAngle, float endAngle, bool anticlockwise, ExceptionState& exceptionState)
259 if (!std::isfinite(x) || !std::isfinite(y) || !std::isfinite(radius) || !std::isfinite(startAngle) || !std::isfinite(endAngle))
270 if (!radius || startAngle == endAngle) {
272 lineTo(x + radius * cosf(startAngle), y + radius * sinf(startAngle));
276 canonicalizeAngle(&startAngle, &endAngle);
277 float adjustedEndAngle = adjustEndAngle(startAngle, endAngle, anticlockwise);
278 m_path.addArc(FloatPoint(x, y), radius, startAngle, adjustedEndAngle, anticlockwise);
281 void CanvasPathMethods::ellipse(float x, float y, float radiusX, float radiusY, float rotation, float startAngle, float endAngle, bool anticlockwise, ExceptionState& exceptionState)
283 if (!std::isfinite(x) || !std::isfinite(y) || !std::isfinite(radiusX) || !std::isfinite(radiusY) || !std::isfinite(rotation) || !std::isfinite(startAngle) || !std::isfinite(endAngle))
294 canonicalizeAngle(&startAngle, &endAngle);
295 float adjustedEndAngle = adjustEndAngle(startAngle, endAngle, anticlockwise);
296 if (!radiusX || !radiusY || startAngle == adjustedEndAngle) {
298 degenerateEllipse(this, x, y, radiusX, radiusY, rotation, startAngle, adjustedEndAngle, anticlockwise);
302 m_path.addEllipse(FloatPoint(x, y), radiusX, radiusY, rotation, startAngle, adjustedEndAngle, anticlockwise);