Beispiel #1
0
        private void PanMap(PointerMovedCanvasEventArgs args)
        {
            var point  = args.EventArgs.GetCurrentPoint(args.Sender as UIElement);
            var vector = new Vector2((float)point.Position.X, (float)point.Position.Y);

            if (args.EventArgs.KeyModifiers.HasFlag(_modifier))
            {
                Engine.Current.CoordinateSystem.ViewCenterOffset += vector - _lastMouseScrollPos;
                _lastMouseScrollPos = vector;
            }
            else
            {
                _lastMouseScrollPos = vector;
            }
        }
Beispiel #2
0
 private void StoreAndHighlightFocusedMapTile(PointerMovedCanvasEventArgs args)
 {
     _lastPointerPoint = args.EventArgs.GetCurrentPoint((UIElement)args.Sender).Position.ToVector2();
 }