You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 11, 2023. It is now read-only.
The pan and zoom doesnt work for Mac, I fixed zoom by creating the PlatformTouchEffect for Mac (used the same file as that of iOS).
To make zoom work,
I added the following to the PlotController.cs,
#if MACCATALYST
this.BindMouseWheel(OxyPlot.PlotCommands.ZoomWheel);
this.BindMouseWheel(OxyModifierKeys.Control, OxyPlot.PlotCommands.ZoomWheelFine);
#endif
added the Pan gesture recognizer, and raised the onTouchAction
CGPoint delta = panGestureRecognizer.TranslationInView(view);
CGPoint point = panGestureRecognizer.LocationInView(view);
var touchArgs = new TouchActionEventArgs(1,
TouchActionType.MouseWheel,
new Point[] { new(point.X, point.Y) },
true)
{
ModifierKeys = OxyModifierKeys.None
};
touchArgs.MouseWheelDelta = (int)((1000 + delta.Y) / 1000);
onTouchAction(Element, touchArgs);
However, it didn't work. Is there something I am missing?
The text was updated successfully, but these errors were encountered:
I don't think the iOS version of the PlatformTouchEffect will work on macOS because iPhones don't handle mouse-related events. For reference, you can take a look at the Xamarin version of the macOS PlatformTouchEffect implementation:PlatformTouchEffect ,and don't forget to add the mouse wheel event.
Thanks for the response, I will take a look at it. With the current code (which I provided in the question) does get me the mouse wheel events. However forwarding it to onTouchAction, doesnt seem to do anything.
The pan and zoom doesnt work for Mac, I fixed zoom by creating the PlatformTouchEffect for Mac (used the same file as that of iOS).
To make zoom work,
I added the following to the PlotController.cs,
#if MACCATALYST
this.BindMouseWheel(OxyPlot.PlotCommands.ZoomWheel);
this.BindMouseWheel(OxyModifierKeys.Control, OxyPlot.PlotCommands.ZoomWheelFine);
#endif
added the Pan gesture recognizer, and raised the onTouchAction
However, it didn't work. Is there something I am missing?
The text was updated successfully, but these errors were encountered: