Exemplo n.º 1
0
 /// <summary>
 /// <see cref="ISingleTouchObserver.OnTouchEnded" />
 /// </summary>
 public void OnTouchEnded(Touch touch)
 {
     if (Touches.Contains(touch))
     {
         if (Surface != null && Tool != null)
         {
             Tool.OnTouchEnded(Surface, touch);
         }
     }
     Touches.Remove(touch);
     if (Touches.Count == 0 && DrawingEnded != null)
     {
         DrawingEnded(this);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// <see cref="ISingleTouchObserver.OnTouchMoved" />
 /// </summary>
 public void OnTouchMoved(Touch touch)
 {
     if (Touches.Contains(touch))
     {
         if (Surface != null && Tool != null)
         {
             Tool.OnTouchMoved(Surface, touch);
         }
     }
     else if (IsAllowedToDrawWithTouch == null || IsAllowedToDrawWithTouch(touch))
     {
         if (Surface != null && Tool != null)
         {
             Touches.Add(touch);
             if (Touches.Count == 1 && DrawingBegan != null)
             {
                 DrawingBegan(this);
             }
             Tool.OnTouchBegan(Surface, touch);
         }
     }
 }