oxyplot / oxyplot-maui

OxyPlot for Maui
MIT License
37 stars 7 forks source link

Multiple TouchEffects cause crash on iOS #9

Open Hackmodford opened 12 months ago

Hackmodford commented 12 months ago

I've noticed a crash in my app if there are multiple graphs.

For example I have two pages with graphs.

If I navigate A -> B -> A then try to touch Graph A, the app crashes in the PlotViewBase.Events.cs file.

image

This is do to previousTouchPoints being nil. It seems that the TouchEffect is associated with the wrong view? Not sure. Or they're all sending reports to each other.

Hackmodford commented 12 months ago

My current solution was to carefully set the InputTransparency property on the graphs to true if they are not visible, but as you can imagine that is a bit of a pain to manage.

This was the original reason for my earlier commit.

janusw commented 12 months ago

Is it possible to reproduce this problem with the sample app? Could you please provide the full error message / exception ?

Hackmodford commented 12 months ago

I'm working on generating a sample project.

I believe I have triggered the issue by having two graphs and starting a drag on one graph and sliding my finger over to the other graph.

Hackmodford commented 12 months ago

Here is my minimal example project. I believe this is the key line causing me issues.

If you try dragging the circle on iOS it will crash.

https://github.com/Hackmodford/oxyplot-maui-crash1

The key seems to be with settings the opacity of the plot. It may also crash if you have the graphs side by side and try starting in one plot and dragging to the other.

In any case the example in the project is what is causing me headaches in my current app.

jaison-t-john commented 5 months ago

@Hackmodford, Can I know if pinch to zoom is working for you in iOS?

RobertStefancic commented 2 months ago

@Hackmodford could you please test the latest version 1.0.1 that includes the fix from https://github.com/oxyplot/oxyplot-maui/issues/10 I took a glance on your issue and this fix has a good probability to solve it.