MyScript / interactive-ink-examples-uwp

:pencil2: MyScript Interactive Ink examples and user interface reference implementation for Windows UWP.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[implementaion] why pass `PointerDeviceType` as a pointer ID, instead of using the real `PointerId`?

jingkecn opened this issue · comments

I read this method and felt confused:

public int GetPointerId(RoutedEventArgs e)
{
   if (e is PointerRoutedEventArgs)
      return (int)((PointerRoutedEventArgs)e).Pointer.PointerDeviceType;
    else if (e is HoldingRoutedEventArgs)
        return (int)((HoldingRoutedEventArgs)e).PointerDeviceType;
     return -1;
}

In the documentations of the methods Editor.Pointer*, the parameter pointerId is supposed to be the pointer id to pass, but in your implementation, you send the PointerDeviceType enum instead of the real pointer id.

May you explain why we should do this if there is any particular reason or is it documented somewhere else?