From 339bbb5985333eac30bc8889b3de0a1db396c991 Mon Sep 17 00:00:00 2001 From: Justin Kunimune Date: Mon, 18 Feb 2019 10:32:53 -0500 Subject: [PATCH] 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. --- src/maps/Projection.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/maps/Projection.java b/src/maps/Projection.java index 19875e0..30ee94f 100644 --- a/src/maps/Projection.java +++ b/src/maps/Projection.java @@ -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); }