Skip to content

Commit 899261b

Browse files
author
lauren mccarthy
committed
adding angleMode support to arc closes #348
1 parent 4c21899 commit 899261b

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

lib/p5.js

+4
Original file line numberDiff line numberDiff line change
@@ -3955,6 +3955,10 @@ var shape2d_primitives = function (require, core, canvas, constants) {
39553955
if (!this._doStroke && !this._doFill) {
39563956
return;
39573957
}
3958+
if (this._angleMode === constants.DEGREES) {
3959+
start = this.radians(start);
3960+
stop = this.radians(stop);
3961+
}
39583962
var ctx = this.drawingContext;
39593963
var vals = canvas.arcModeAdjust(x, y, width, height, this._ellipseMode);
39603964
var radius = vals.h > vals.w ? vals.h / 2 : vals.w / 2, xScale = vals.h > vals.w ? vals.w / vals.h : 1, yScale = vals.h > vals.w ? 1 : vals.h / vals.w;

lib/p5.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/objects/p5.Element.js

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ define(function(require) {
5151
* var cnv = createCanvas(100, 100);
5252
* cnv.parent("myContainer");
5353
* </code></div>
54-
* @example
5554
* <div class='norender'><code>
5655
* var div0 = createDiv('this is the parent');
5756
* var div1 = createDiv('this is the child');

src/shape/2d_primitives.js

+4
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ define(function (require) {
6767
if (!this._doStroke && !this._doFill) {
6868
return;
6969
}
70+
if (this._angleMode === constants.DEGREES) {
71+
start = this.radians(start);
72+
stop = this.radians(stop);
73+
}
7074
var ctx = this.drawingContext;
7175
var vals = canvas.arcModeAdjust(
7276
x,

0 commit comments

Comments
 (0)