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); }
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); }
private void updateInfo(Point pos) { Point p = transform.MapToWorld(pos.X, pos.Y); p = new Point(Math.Round(p.X), Math.Round(-p.Y)); if (p.X < 0) { p.X = 0; } if (p.X > 524288) { p.X = 524288; } if (p.Y < 0) { p.Y = 0; } if (p.Y > 524288) { p.Y = 524288; } Coords = string.Format("X: {0}\nY: {1}", p.X, p.Y); }