Skip to content

Commit 915702a

Browse files
committed
Fix accidental global context.
1 parent d52a3e7 commit 915702a

3 files changed

Lines changed: 18 additions & 20 deletions

File tree

d3.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5495,38 +5495,37 @@
54955495
function circle() {
54965496
var o = typeof origin === "function" ? origin.apply(this, arguments) : origin;
54975497
rotate = d3_geo_rotation(-o[0] * d3_radians, -o[1] * d3_radians, 0);
5498-
var rings = [ [] ];
5499-
context = bufferContext(rings);
5498+
var rings = [ [] ], context = bufferContext(rings);
55005499
d3_geo_circleInterpolateCircle(interpolate, context);
55015500
context.closePath();
55025501
return {
55035502
type: "Polygon",
55045503
coordinates: rings
55055504
};
55065505
}
5507-
function bufferContext(lineStrings) {
5508-
var lineString = lineStrings[0];
5506+
function bufferContext(rings) {
5507+
var ring = rings[0];
55095508
return {
55105509
point: function(λ, φ) {
55115510
var point = rotate.invert(λ, φ);
55125511
point[0] *= d3_degrees;
55135512
point[1] *= d3_degrees;
5514-
lineStrings.push(point);
5513+
rings.push(point);
55155514
},
55165515
moveTo: function(λ, φ) {
55175516
var point = rotate.invert(λ, φ);
55185517
point[0] *= d3_degrees;
55195518
point[1] *= d3_degrees;
5520-
lineStrings.push(lineString = [ point ]);
5519+
rings.push(ring = [ point ]);
55215520
},
55225521
lineTo: function(λ, φ) {
55235522
var point = rotate.invert(λ, φ);
55245523
point[0] *= d3_degrees;
55255524
point[1] *= d3_degrees;
5526-
lineString.push(point);
5525+
ring.push(point);
55275526
},
55285527
closePath: function() {
5529-
if (lineString.length) lineString.push(lineString[0]);
5528+
if (ring.length) ring.push(ring[0]);
55305529
}
55315530
};
55325531
}

0 commit comments

Comments
 (0)