This commit is contained in:
Jason Davies 2012-09-26 18:30:36 +01:00
Родитель f7174ce1a1
Коммит a91954bbac
3 изменённых файлов: 10 добавлений и 12 удалений

8
d3.v2.js поставляемый
Просмотреть файл

@ -2082,14 +2082,14 @@
p.line = function(coordinates, context) {
if (!(n = coordinates.length)) return;
context = resample(context);
var point = rotatePoint(coordinates[0]), λ0 = point[0], φ0 = point[1], λ1, φ1, sλ0 = λ0 > 0 ? π : -π, sλ1, δλ, i = 0, n;
var point = rotatePoint(coordinates[0]), λ0 = point[0], φ0 = point[1], λ1, φ1, sλ0 = λ0 > 0 ? π : -π, sλ1, i = 0, n;
context.moveTo(λ0, φ0);
while (++i < n) {
point = rotatePoint(coordinates[i]);
λ1 = point[0];
φ1 = point[1];
sλ1 = λ1 > 0 ? π : -π;
if (sλ0 !== sλ1 && (δλ = Math.abs(λ1 - λ0)) >= π) {
if (sλ0 !== sλ1 && Math.abs(λ1 - λ0) >= π) {
φ0 = d3_geo_projectionIntersectAntemeridian(λ0, φ0, λ1, φ1);
context.lineTo(sλ0, φ0);
context.moveTo(sλ1, φ0);
@ -2101,13 +2101,13 @@
p.ring = function(coordinates, context) {
if (!(n = coordinates.length)) return;
context = resample(context);
var point = rotatePoint(coordinates[0]), λ0 = point[0], φ0 = point[1], segment = [ point ], λ1, φ1, sλ0 = λ0 > 0 ? π : -π, sλ1, segmentSide, δλ, i = 0, first = true, side, n;
var point = rotatePoint(coordinates[0]), λ0 = point[0], φ0 = point[1], segment = [ point ], λ1, φ1, sλ0 = λ0 > 0 ? π : -π, sλ1, segmentSide, i = 0, first = true, side, n;
while (++i < n) {
point = rotatePoint(coordinates[i]);
λ1 = point[0];
φ1 = point[1];
sλ1 = λ1 > 0 ? π : -π;
if (sλ0 !== sλ1 && (δλ = Math.abs(λ1 - λ0)) >= π) {
if (sλ0 !== sλ1 && Math.abs(λ1 - λ0) >= π) {
φ0 = d3_geo_projectionIntersectAntemeridian(λ0, φ0, λ1, φ1);
if (first) segment.push([ sλ0, φ0 ]), segmentSide = sλ0; else {
context.lineTo(sλ0, φ0);

8
d3.v2.min.js поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -46,7 +46,6 @@ function d3_geo_projectionMutator(projectAt) {
φ1,
sλ0 = λ0 > 0 ? π : -π,
sλ1,
δλ,
i = 0,
n;
context.moveTo(λ0, φ0);
@ -55,7 +54,7 @@ function d3_geo_projectionMutator(projectAt) {
λ1 = point[0];
φ1 = point[1];
sλ1 = λ1 > 0 ? π : -π;
if (sλ0 !== sλ1 && (δλ = Math.abs(λ1 - λ0)) >= π) {
if (sλ0 !== sλ1 && Math.abs(λ1 - λ0) >= π) {
φ0 = d3_geo_projectionIntersectAntemeridian(λ0, φ0, λ1, φ1);
context.lineTo(sλ0, φ0);
context.moveTo(sλ1, φ0);
@ -77,7 +76,6 @@ function d3_geo_projectionMutator(projectAt) {
sλ0 = λ0 > 0 ? π : -π,
sλ1,
segmentSide, // the side of the last point in the buffered segment.
δλ,
i = 0,
first = true, // true when no intersections have been found yet.
side, // the side of the last start point (moveTo call).
@ -87,7 +85,7 @@ function d3_geo_projectionMutator(projectAt) {
λ1 = point[0];
φ1 = point[1];
sλ1 = λ1 > 0 ? π : -π;
if (sλ0 !== sλ1 && (δλ = Math.abs(λ1 - λ0)) >= π) {
if (sλ0 !== sλ1 && Math.abs(λ1 - λ0) >= π) {
φ0 = d3_geo_projectionIntersectAntemeridian(λ0, φ0, λ1, φ1);
if (first) segment.push([sλ0, φ0]), segmentSide = sλ0;
else {