private long getCloserPixel(long pPixel, final int pScreenLimitFirst, final int pScreenLimitLast, final double pMapSize) {
		final long center = (pScreenLimitFirst + pScreenLimitLast) / 2;
		long previous = 0;
		if (pPixel < pScreenLimitFirst) {
			while (pPixel < pScreenLimitFirst) {
				previous = pPixel;
				pPixel += pMapSize;
			}
			if (pPixel < pScreenLimitLast) {
				return pPixel;
			}
			if (Math.abs(center - pPixel) < Math.abs(center - previous)) {
				return pPixel;
			}
			return previous;
		}

		while (pPixel >= pScreenLimitFirst) {
			previous = pPixel;
			pPixel -= pMapSize;
		}
		if (previous < pScreenLimitLast) {
			return previous;
		}
		if (Math.abs(center - pPixel) < Math.abs(center - previous)) {
			return pPixel;
		}
		return previous;
	}
private long getCloserPixel ( long pPixel , final int pScreenLimitFirst , final int pScreenLimitLast , final double pMapSize ) { final long center = ( pScreenLimitFirst + pScreenLimitLast ) / 2 ; long previous = 0 ; if ( pPixel < pScreenLimitFirst ) { while ( pPixel < pScreenLimitFirst ) { previous = pPixel ; pPixel += pMapSize ; } if ( pPixel < pScreenLimitLast ) { return pPixel ; } if ( Math . abs ( center - pPixel ) < Math . abs ( center - previous ) ) { return pPixel ; } return previous ; } while ( pPixel >= pScreenLimitFirst ) { previous = pPixel ; pPixel -= pMapSize ; } if ( previous < pScreenLimitLast ) { return previous ; } if ( Math . abs ( center - pPixel ) < Math . abs ( center - previous ) ) { return pPixel ; } return previous ; }
@since 6.0.0
Correction of pixel value.
Pixel values are identical, modulo mapSize.
What we explicitly want is either:
* the visible pixel that is the closest to the left (first choice)
* the invisible pixel that is the closest to the screen center