File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/main/java/com/mapcode Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ public static double metersToDegreesLonAtLat(final double eastMeters, final doub
195195 @ Nonnull
196196 @ Override
197197 public String toString () {
198- return defined ? ("(" + getLatDeg () + ", " + getLonDeg ( ) + ')' ) : "undefined" ;
198+ return defined ? ("(" + ( lat32 / 1000000.0 )+ "|" +( fraclat / 810000.0 ) + ", " + ( lon32 / 1000000.0 )+ "|" +( fraclon / 3240000.0 ) + ')' ) : "undefined" ;
199199 }
200200
201201 @ SuppressWarnings ("NonFinalFieldReferencedInHashCode" )
@@ -230,15 +230,16 @@ public boolean equals(final Object obj) {
230230 private double fraclon ; // whole nr of MICROLON_MAX_PRECISION_FACTOR, relative to lon32
231231
232232 public void setMaxLatToMicroDeg (final int maxMicroLat ) {
233- if ( ( lat32 > maxMicroLat ) || (( lat32 == maxMicroLat ) && ( fraclat > 0 )) ) {
233+ if (lat32 >= maxMicroLat ) {
234234 lat32 = maxMicroLat -1 ;
235235 fraclat = FRACLAT_PRECISION_FACTOR - 1 ;
236236 }
237237 }
238238
239239 public void setMaxLonToMicroDeg (final int maxMicroLon ) {
240- if ( (lon32 > maxMicroLon ) || ((lon32 == maxMicroLon ) && (fraclon >0 )) ) {
241- lon32 = maxMicroLon -1 ;
240+ int max = (maxMicroLon < 0 && lon32 > 0 ) ? maxMicroLon + 360000000 : maxMicroLon ;
241+ if (lon32 >= max ) {
242+ lon32 = max - 1 ;
242243 fraclon = FRACLON_PRECISION_FACTOR - 1 ;
243244 }
244245 }
You can’t perform that action at this time.
0 commit comments