@@ -25,7 +25,7 @@ window.Processing = require('./src/')(Browser);
25
25
},{"./src/":28}],2:[function(require,module,exports){
26
26
module.exports={
27
27
"name": "processing-js",
28
- "version": "1.4.13 ",
28
+ "version": "1.4.14 ",
29
29
"author": "Processing.js",
30
30
"repository": {
31
31
"type": "git",
@@ -5039,7 +5039,7 @@ module.exports = function(options, undef) {
5039
5039
};
5040
5040
5041
5041
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 ()));
5043
5043
};
5044
5044
5045
5045
PVector.lerp = function(v1, v2, amt) {
@@ -17600,18 +17600,21 @@ module.exports = function setupParser(Processing, options) {
17600
17600
vr = height / 2,
17601
17601
centerX = x + hr,
17602
17602
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
+
17606
17606
if (doFill) {
17607
17607
// shut off stroke for a minute
17608
17608
var savedStroke = doStroke;
17609
17609
doStroke = false;
17610
17610
p.beginShape();
17611
17611
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
+ );
17615
17618
}
17616
17619
p.endShape(PConstants.CLOSE);
17617
17620
doStroke = savedStroke;
@@ -17622,9 +17625,12 @@ module.exports = function setupParser(Processing, options) {
17622
17625
var savedFill = doFill;
17623
17626
doFill = false;
17624
17627
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
+ );
17628
17634
}
17629
17635
p.endShape();
17630
17636
doFill = savedFill;
0 commit comments