Simplify scrollPanGesture handling
This commit is contained in:
1 parent
cf8a5609c0
commit
10aa3d07e8
3 files changed
+4
-5
No files matched your search
@@ -896,7 +896,7 @@ public class GLFW
|
||||
try {
|
||||
// long __result = nglfwGetVideoModes(monitor, memAddress(count));
|
||||
long __result = glfwGetVideoMode(monitor).address();
|
||||
return GLFWVidMode.createSafe(__result, 1);;
|
||||
return GLFWVidMode.createSafe(__result, 1);
|
||||
} finally {
|
||||
stack.setPointer(stackPointer);
|
||||
}
|
||||
|
||||
@@ -310,6 +310,7 @@ self.view.frame.size.width * 0.3 - 36.0 * 0.7, self.view.frame.size.height)];
|
||||
self.scrollPanGesture.delegate = self;
|
||||
self.scrollPanGesture.minimumNumberOfTouches = 2;
|
||||
self.scrollPanGesture.maximumNumberOfTouches = 2;
|
||||
[self.surfaceView addGestureRecognizer:self.scrollPanGesture];
|
||||
|
||||
if (@available(iOS 13.4, *)) {
|
||||
[self.surfaceView addInteraction:[[UIPointerInteraction alloc] initWithDelegate:self]];
|
||||
|
||||
@@ -275,13 +275,11 @@ JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSetGrabbing(JNIE
|
||||
CGFloat screenScale = [[UIScreen mainScreen] scale] * resolutionScale;
|
||||
callback_SurfaceViewController_onTouch(ACTION_DOWN, lastVirtualMousePoint.x * screenScale, lastVirtualMousePoint.y * screenScale);
|
||||
((SurfaceViewController *)currentVC()).mousePointerView.frame = virtualMouseFrame;
|
||||
[surfaceView removeGestureRecognizer:((SurfaceViewController *)currentVC()).scrollPanGesture];
|
||||
} else {
|
||||
[surfaceView addGestureRecognizer:((SurfaceViewController *)currentVC()).scrollPanGesture];
|
||||
}
|
||||
((SurfaceViewController *)currentVC()).scrollPanGesture.enabled = !isGrabbing;
|
||||
((SurfaceViewController *)currentVC()).mousePointerView.hidden = isGrabbing || !virtualMouseEnabled;
|
||||
if(@available(iOS 14.0, *)) {
|
||||
[currentVC() setNeedsUpdateOfPrefersPointerLocked];
|
||||
[(SurfaceViewController *)currentVC() setNeedsUpdateOfPrefersPointerLocked];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user