summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2016-02-09 20:56:07 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2016-03-01 20:58:54 +0000
commit4994b3dc574443ad6e24ea1d715e0ebcdbb0f124 (patch)
treef8b61e5acc88502b740f401deb61679126b1cbd0 /platform
parent1ce99d2d7b1921dfac1d302553160184ceac7d3e (diff)
downloadqtlocation-mapboxgl-4994b3dc574443ad6e24ea1d715e0ebcdbb0f124.tar.gz
[core] PrecisionPoint is now ScreenCoordinate
Diffstat (limited to 'platform')
-rwxr-xr-xplatform/android/src/jni.cpp14
-rw-r--r--platform/default/glfw_view.cpp4
-rw-r--r--platform/ios/src/MGLMapView.mm6
-rw-r--r--platform/osx/src/MGLMapView.mm8
4 files changed, 16 insertions, 16 deletions
diff --git a/platform/android/src/jni.cpp b/platform/android/src/jni.cpp
index c60721ceb3..f8ad7b6fca 100755
--- a/platform/android/src/jni.cpp
+++ b/platform/android/src/jni.cpp
@@ -732,7 +732,7 @@ void JNICALL nativeMoveBy(JNIEnv *env, jobject obj, jlong nativeMapViewPtr, jdou
mbgl::Log::Debug(mbgl::Event::JNI, "nativeMoveBy");
assert(nativeMapViewPtr != 0);
NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr);
- mbgl::PrecisionPoint center(dx, dy);
+ mbgl::ScreenCoordinate center(dx, dy);
nativeMapView->getMap().moveBy(center, mbgl::Milliseconds(duration));
}
@@ -799,7 +799,7 @@ void JNICALL nativeScaleBy(JNIEnv *env, jobject obj, jlong nativeMapViewPtr, jdo
mbgl::Log::Debug(mbgl::Event::JNI, "nativeScaleBy");
assert(nativeMapViewPtr != 0);
NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr);
- mbgl::PrecisionPoint center(cx, cy);
+ mbgl::ScreenCoordinate center(cx, cy);
nativeMapView->getMap().scaleBy(ds, center, mbgl::Milliseconds(duration));
}
@@ -808,7 +808,7 @@ void JNICALL nativeSetScale(JNIEnv *env, jobject obj, jlong nativeMapViewPtr, jd
mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetScale");
assert(nativeMapViewPtr != 0);
NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr);
- mbgl::PrecisionPoint center(cx, cy);
+ mbgl::ScreenCoordinate center(cx, cy);
nativeMapView->getMap().setScale(scale, center, mbgl::Milliseconds(duration));
}
@@ -873,8 +873,8 @@ void JNICALL nativeRotateBy(JNIEnv *env, jobject obj, jlong nativeMapViewPtr, jd
mbgl::Log::Debug(mbgl::Event::JNI, "nativeRotateBy");
assert(nativeMapViewPtr != 0);
NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr);
- mbgl::PrecisionPoint first(sx, sy);
- mbgl::PrecisionPoint second(ex, ey);
+ mbgl::ScreenCoordinate first(sx, sy);
+ mbgl::ScreenCoordinate second(ex, ey);
nativeMapView->getMap().rotateBy(first, second, mbgl::Milliseconds(duration));
}
@@ -892,7 +892,7 @@ void JNICALL nativeSetBearing(JNIEnv *env, jobject obj, jlong nativeMapViewPtr,
mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetBearing");
assert(nativeMapViewPtr != 0);
NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr);
- mbgl::PrecisionPoint center(cx, cy);
+ mbgl::ScreenCoordinate center(cx, cy);
nativeMapView->getMap().setBearing(degrees, center);
}
@@ -1559,7 +1559,7 @@ jobject JNICALL nativeLatLngForPixel(JNIEnv *env, jobject obj, jlong nativeMapVi
return nullptr;
}
- mbgl::LatLng latLng = nativeMapView->getMap().latLngForPixel(mbgl::PrecisionPoint(x, y));
+ mbgl::LatLng latLng = nativeMapView->getMap().latLngForPixel(mbgl::ScreenCoordinate(x, y));
jobject ret = env->NewObject(latLngClass, latLngConstructorId, latLng.latitude, latLng.longitude);
if (ret == nullptr) {
diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp
index a4e8d7059f..790b0a4dd7 100644
--- a/platform/default/glfw_view.cpp
+++ b/platform/default/glfw_view.cpp
@@ -380,8 +380,8 @@ void GLFWView::onMouseMove(GLFWwindow *window, double x, double y) {
double dy = y - view->lastY;
if (dx || dy) {
view->map->setLatLng(
- view->map->latLngForPixel(mbgl::PrecisionPoint(x - dx, y - dy)),
- mbgl::PrecisionPoint(x, y));
+ view->map->latLngForPixel(mbgl::ScreenCoordinate(x - dx, y - dy)),
+ mbgl::ScreenCoordinate(x, y));
}
} else if (view->rotating) {
view->map->rotateBy({ view->lastX, view->lastY }, { x, y });
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 458221fd69..5fe26b35d6 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -1333,7 +1333,7 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration)
gesturePoint = self.userLocationAnnotationViewCenter;
}
- mbgl::PrecisionPoint center(gesturePoint.x, gesturePoint.y);
+ mbgl::ScreenCoordinate center(gesturePoint.x, gesturePoint.y);
_mbglMap->scaleBy(2, center, MGLDurationInSeconds(MGLAnimationDuration));
__weak MGLMapView *weakSelf = self;
@@ -1365,7 +1365,7 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration)
gesturePoint = self.userLocationAnnotationViewCenter;
}
- mbgl::PrecisionPoint center(gesturePoint.x, gesturePoint.y);
+ mbgl::ScreenCoordinate center(gesturePoint.x, gesturePoint.y);
_mbglMap->scaleBy(0.5, center, MGLDurationInSeconds(MGLAnimationDuration));
__weak MGLMapView *weakSelf = self;
@@ -2166,7 +2166,7 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration)
- (mbgl::LatLng)convertPoint:(CGPoint)point toLatLngFromView:(nullable UIView *)view
{
CGPoint convertedPoint = [self convertPoint:point fromView:view];
- return _mbglMap->latLngForPixel(mbgl::PrecisionPoint(convertedPoint.x, convertedPoint.y));
+ return _mbglMap->latLngForPixel(mbgl::ScreenCoordinate(convertedPoint.x, convertedPoint.y));
}
- (CGPoint)convertCoordinate:(CLLocationCoordinate2D)coordinate toPointToView:(nullable UIView *)view
diff --git a/platform/osx/src/MGLMapView.mm b/platform/osx/src/MGLMapView.mm
index cd8cd45265..94971e55b1 100644
--- a/platform/osx/src/MGLMapView.mm
+++ b/platform/osx/src/MGLMapView.mm
@@ -899,7 +899,7 @@ public:
- (void)scaleBy:(double)scaleFactor atPoint:(NSPoint)point animated:(BOOL)animated {
[self willChangeValueForKey:@"centerCoordinate"];
[self willChangeValueForKey:@"zoomLevel"];
- mbgl::PrecisionPoint center(point.x, self.bounds.size.height - point.y);
+ mbgl::ScreenCoordinate center(point.x, self.bounds.size.height - point.y);
_mbglMap->scaleBy(scaleFactor, center, MGLDurationInSeconds(animated ? MGLAnimationDuration : 0));
[self didChangeValueForKey:@"zoomLevel"];
[self didChangeValueForKey:@"centerCoordinate"];
@@ -1214,7 +1214,7 @@ public:
_directionAtBeginningOfGesture = self.direction;
_pitchAtBeginningOfGesture = _mbglMap->getPitch();
} else if (gestureRecognizer.state == NSGestureRecognizerStateChanged) {
- mbgl::PrecisionPoint center(startPoint.x, self.bounds.size.height - startPoint.y);
+ mbgl::ScreenCoordinate center(startPoint.x, self.bounds.size.height - startPoint.y);
if (self.rotateEnabled) {
CLLocationDirection newDirection = _directionAtBeginningOfGesture - delta.x / 10;
[self willChangeValueForKey:@"direction"];
@@ -1258,7 +1258,7 @@ public:
_scaleAtBeginningOfGesture = _mbglMap->getScale();
} else if (gestureRecognizer.state == NSGestureRecognizerStateChanged) {
NSPoint zoomInPoint = [gestureRecognizer locationInView:self];
- mbgl::PrecisionPoint center(zoomInPoint.x, self.bounds.size.height - zoomInPoint.y);
+ mbgl::ScreenCoordinate center(zoomInPoint.x, self.bounds.size.height - zoomInPoint.y);
if (gestureRecognizer.magnification > -1) {
[self willChangeValueForKey:@"zoomLevel"];
[self willChangeValueForKey:@"centerCoordinate"];
@@ -1339,7 +1339,7 @@ public:
_directionAtBeginningOfGesture = self.direction;
} else if (gestureRecognizer.state == NSGestureRecognizerStateChanged) {
NSPoint rotationPoint = [gestureRecognizer locationInView:self];
- mbgl::PrecisionPoint center(rotationPoint.x, self.bounds.size.height - rotationPoint.y);
+ mbgl::ScreenCoordinate center(rotationPoint.x, self.bounds.size.height - rotationPoint.y);
_mbglMap->setBearing(_directionAtBeginningOfGesture + gestureRecognizer.rotationInDegrees, center);
} else if (gestureRecognizer.state == NSGestureRecognizerStateEnded
|| gestureRecognizer.state == NSGestureRecognizerStateCancelled) {