Exemplo n.º 1
0
 public static void Pan(MapTransform transform, Point currentMap, Point previousMap)
 {
     Point current = transform.MapToWorld(currentMap.X, currentMap.Y);
     Point previous = transform.MapToWorld(previousMap.X, previousMap.Y);
     double diffX = previous.X - current.X;
     double diffY = previous.Y - current.Y;
     transform.Center = new Point(transform.Center.X + diffX, transform.Center.Y + diffY);
 }
Exemplo n.º 2
0
        public static void Pan(MapTransform transform, Point currentMap, Point previousMap)
        {
            Point  current  = transform.MapToWorld(currentMap.X, currentMap.Y);
            Point  previous = transform.MapToWorld(previousMap.X, previousMap.Y);
            double diffX    = previous.X - current.X;
            double diffY    = previous.Y - current.Y;

            transform.Center = new Point(transform.Center.X + diffX, transform.Center.Y + diffY);
        }