[core] PrecisionPoint is now ScreenCoordinate
This commit is contained in:
@@ -249,11 +249,11 @@ double TransformState::worldSize() const {
|
||||
return scale * util::tileSize;
|
||||
}
|
||||
|
||||
PrecisionPoint TransformState::latLngToPoint(const LatLng& latLng) const {
|
||||
ScreenCoordinate TransformState::latLngToScreenCoordinate(const LatLng& latLng) const {
|
||||
return coordinateToPoint(latLngToCoordinate(latLng));
|
||||
}
|
||||
|
||||
LatLng TransformState::pointToLatLng(const PrecisionPoint& point) const {
|
||||
LatLng TransformState::screenCoordinateToLatLng(const ScreenCoordinate& point) const {
|
||||
return coordinateToLatLng(pointToCoordinate(point));
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ LatLng TransformState::coordinateToLatLng(const TileCoordinate& coord) const {
|
||||
return latLng;
|
||||
}
|
||||
|
||||
PrecisionPoint TransformState::coordinateToPoint(const TileCoordinate& coord) const {
|
||||
ScreenCoordinate TransformState::coordinateToPoint(const TileCoordinate& coord) const {
|
||||
mat4 mat = coordinatePointMatrix(coord.zoom);
|
||||
vec4<double> p;
|
||||
vec4<double> c = { coord.column, coord.row, 0, 1 };
|
||||
@@ -284,7 +284,7 @@ PrecisionPoint TransformState::coordinateToPoint(const TileCoordinate& coord) co
|
||||
return { p.x / p.w, height - p.y / p.w };
|
||||
}
|
||||
|
||||
TileCoordinate TransformState::pointToCoordinate(const PrecisionPoint& point) const {
|
||||
TileCoordinate TransformState::pointToCoordinate(const ScreenCoordinate& point) const {
|
||||
|
||||
float targetZ = 0;
|
||||
const double tileZoom = getZoom();
|
||||
@@ -366,7 +366,7 @@ void TransformState::constrain(double& scale_, double& x_, double& y_) const {
|
||||
}
|
||||
}
|
||||
|
||||
void TransformState::moveLatLng(const LatLng& latLng, const PrecisionPoint& anchor) {
|
||||
void TransformState::moveLatLng(const LatLng& latLng, const ScreenCoordinate& anchor) {
|
||||
if (!latLng || !anchor) {
|
||||
return;
|
||||
}
|
||||
@@ -395,16 +395,16 @@ void TransformState::setLatLngZoom(const LatLng &latLng, double zoom) {
|
||||
const double m = 1 - 1e-15;
|
||||
const double f = util::clamp(std::sin(util::DEG2RAD * latLng.latitude), -m, m);
|
||||
|
||||
PrecisionPoint point = {
|
||||
ScreenCoordinate point = {
|
||||
-latLng.longitude * Bc,
|
||||
0.5 * Cc * std::log((1 + f) / (1 - f)),
|
||||
};
|
||||
setScalePoint(newScale, point);
|
||||
}
|
||||
|
||||
void TransformState::setScalePoint(const double newScale, const PrecisionPoint &point) {
|
||||
void TransformState::setScalePoint(const double newScale, const ScreenCoordinate &point) {
|
||||
double constrainedScale = newScale;
|
||||
PrecisionPoint constrainedPoint = point;
|
||||
ScreenCoordinate constrainedPoint = point;
|
||||
constrain(constrainedScale, constrainedPoint.x, constrainedPoint.y);
|
||||
|
||||
scale = constrainedScale;
|
||||
|
||||
Reference in New Issue
Block a user