Skip to content

Commit ef826b9

Browse files
committed
v1.4.14 builds
1 parent 90be73d commit ef826b9

File tree

2 files changed

+272
-266
lines changed

2 files changed

+272
-266
lines changed

processing.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ window.Processing = require('./src/')(Browser);
2525
},{"./src/":28}],2:[function(require,module,exports){
2626
module.exports={
2727
"name": "processing-js",
28-
"version": "1.4.13",
28+
"version": "1.4.14",
2929
"author": "Processing.js",
3030
"repository": {
3131
"type": "git",
@@ -5039,7 +5039,7 @@ module.exports = function(options, undef) {
50395039
};
50405040

50415041
PVector.angleBetween = function(v1, v2) {
5042-
return Math.acos(v1.dot(v2) / (v1.mag() * v2.mag()));
5042+
return Math.acos(v1.dot(v2) / Math.sqrt(v1.magSq() * v2.magSq()));
50435043
};
50445044

50455045
PVector.lerp = function(v1, v2, amt) {
@@ -17600,18 +17600,21 @@ module.exports = function setupParser(Processing, options) {
1760017600
vr = height / 2,
1760117601
centerX = x + hr,
1760217602
centerY = y + vr,
17603-
startLUT = 0 | (0.5 + start * p.RAD_TO_DEG * 2),
17604-
stopLUT = 0 | (0.5 + stop * p.RAD_TO_DEG * 2),
17605-
i, j;
17603+
step = (stop-start)/10,
17604+
i, angle;
17605+
1760617606
if (doFill) {
1760717607
// shut off stroke for a minute
1760817608
var savedStroke = doStroke;
1760917609
doStroke = false;
1761017610
p.beginShape();
1761117611
p.vertex(centerX, centerY);
17612-
for (i = startLUT; i <= stopLUT; i++) {
17613-
j = i % PConstants.SINCOS_LENGTH;
17614-
p.vertex(centerX + cosLUT[j] * hr, centerY + sinLUT[j] * vr);
17612+
for (i=0, angle; start + i*step < stop + step; i++) {
17613+
angle = start + i*step;
17614+
p.vertex(
17615+
Math.floor(centerX + Math.cos(angle) * hr),
17616+
Math.floor(centerY + Math.sin(angle) * vr)
17617+
);
1761517618
}
1761617619
p.endShape(PConstants.CLOSE);
1761717620
doStroke = savedStroke;
@@ -17622,9 +17625,12 @@ module.exports = function setupParser(Processing, options) {
1762217625
var savedFill = doFill;
1762317626
doFill = false;
1762417627
p.beginShape();
17625-
for (i = startLUT; i <= stopLUT; i++) {
17626-
j = i % PConstants.SINCOS_LENGTH;
17627-
p.vertex(centerX + cosLUT[j] * hr, centerY + sinLUT[j] * vr);
17628+
for (i=0, angle; start + i*step < stop + step; i++) {
17629+
angle = start + i*step;
17630+
p.vertex(
17631+
Math.floor(centerX + Math.cos(angle) * hr),
17632+
Math.floor(centerY + Math.sin(angle) * vr)
17633+
);
1762817634
}
1762917635
p.endShape();
1763017636
doFill = savedFill;

0 commit comments

Comments
 (0)