Closed janusw closed 3 weeks ago
Carry-over from https://github.com/iniceice88/OxyPlot.Maui.Skia/issues/4 (reported by @KunalKshatriya):
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,
this.BindMouseWheel(OxyPlot.PlotCommands.ZoomWheel); this.BindMouseWheel(OxyModifierKeys.Control, OxyPlot.PlotCommands.ZoomWheelFine);
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?
Carry-over from https://github.com/iniceice88/OxyPlot.Maui.Skia/issues/4 (reported by @KunalKshatriya):
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?