mirror of
https://github.com/csharpee/Map-Projections.git
synced 2025-12-10 00:00:19 -05:00
Wow, that was bad.
I found a bug where maps that had no aspect would still use the aspect of the previous map, and to fix it, the user would have to go back to a map with an aspect, set it to standard, and then go back and reload the aspectless one. That has now been corrected.
This commit is contained in:
parent
34e1dbdeb8
commit
339bbb5985
@ -164,7 +164,7 @@ public abstract class Projection {
|
||||
}
|
||||
|
||||
public double[] project(double lat, double lon, double[] pole) {
|
||||
return project(obliquifySphc(lat, lon, pole));
|
||||
return project(obliquifySphc(lat, lon, hasAspect ? pole : null));
|
||||
}
|
||||
|
||||
public double[] project(double lat, double lon, double[] pole, double... params) {
|
||||
@ -186,6 +186,7 @@ public abstract class Projection {
|
||||
}
|
||||
|
||||
public double[] inverse(double x, double y, double[] pole, double... params) {
|
||||
if (!hasAspect) pole = NORTH_POLE;
|
||||
setParameters(params);
|
||||
return inverse(x, y, pole);
|
||||
}
|
||||
@ -195,7 +196,7 @@ public abstract class Projection {
|
||||
if (relCoords == null || (cropAtPi && Math.abs(relCoords[1]) > Math.PI))
|
||||
return null; //cropAtPi removes all points with longitudes outside +- PI
|
||||
else
|
||||
return obliquifyPlnr(relCoords, pole);
|
||||
return obliquifyPlnr(relCoords, hasAspect ? pole : null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user