radioman / greatmaps

GMap.NET - Great Maps for Windows Forms & Presentation
909 stars 409 forks source link

Bugfix for touch panning in WPF #165

Open Ksero opened 4 years ago

Ksero commented 4 years ago

Previously, there was no handler for OnManipulationStarted, so the Core.mouseDown and Core.mouseCurrent were never initialized for the touch manipulation. This resulted in eg. a sudden movement as soon as a user touched a single finger on the GMapControl.

Added a separate touchCurrent variable for keeping track of the accumulated touch pan operation, to prevent problems if some event changes the mouseCurrent during the touch manipulation operation.

WPF also has separate fields for the accumulated translation, which could simplify the code quite a bit. However, that would mean a breaking change in the interface of SingleTouchPanMap, and I'm not sure how you feel about that. Would you prefer that version?