diff --git a/core/src/tangram.cpp b/core/src/tangram.cpp index 4d3cac744a..62ebce7d15 100644 --- a/core/src/tangram.cpp +++ b/core/src/tangram.cpp @@ -534,7 +534,7 @@ bool lngLatToScreenPosition(double _lng, double _lat, double* _x, double* _y) { bool withinViewport = *_x >= 0. && *_x <= m_view->getWidth() && *_y >= 0. && *_y <= m_view->getHeight(); - return clipped || !withinViewport; + return !clipped && withinViewport; } void setPixelScale(float _pixelsPerPoint) { diff --git a/core/src/tangram.h b/core/src/tangram.h index fdc9968a5f..3955a892ca 100644 --- a/core/src/tangram.h +++ b/core/src/tangram.h @@ -91,7 +91,7 @@ float getTilt(); void screenPositionToLngLat(double _x, double _y, double* _lng, double* _lat); // Transform longitude and latitude coordinates into their position in screen space -// (x right, y down); returns true if the (lat,lon) is not visible on the screen +// (x right, y down); returns true if the (lat,lon) is visible on the screen bool lngLatToScreenPosition(double _lng, double _lat, double* _x, double* y); // Set the ratio of hardware pixels to logical pixels (defaults to 1.0)