Example #1
0
        public void SetWorldCenter(RealPoint center)
        {
            WorldRect  = WorldRect.SetCenter(center);
            WorldScale = new WorldScale(WorldScale.Factor, -WorldScale.RealToScreenDistance(WorldRect.X), -WorldScale.RealToScreenDistance(WorldRect.Y));

            WorldChange?.Invoke();
        }
Example #2
0
        public void SetScreenSize(Size size)
        {
            WorldRect   = WorldRect.ExpandWidth(WorldScale.ScreenToRealDistance(size.Width));
            WorldRect   = WorldRect.ExpandHeight(WorldScale.ScreenToRealDistance(size.Height));
            _screenSize = size;

            WorldChange?.Invoke();
        }
Example #3
0
        public void SetZoomFactor(double mmPerPixel)
        {
            RealPoint center = WorldRect.Center();

            WorldRect = WorldRect.ExpandWidth(WorldRect.Width * (mmPerPixel / WorldScale.Factor));
            WorldRect = WorldRect.ExpandHeight(WorldRect.Height * (mmPerPixel / WorldScale.Factor));

            WorldScale = new WorldScale(mmPerPixel, (int)(-WorldRect.X / mmPerPixel), (int)(-WorldRect.Y / mmPerPixel));

            WorldChange?.Invoke();
        }
Example #4
0
 public WorldDimensions()
 {
     WorldScale = new WorldScale(5, 0, 0);
     WorldRect  = new RectangleF();
 }
Example #5
0
 public WorldScale(WorldScale other)
 {
     Factor  = other.Factor;
     OffsetX = other.OffsetX;
     OffsetY = other.OffsetY;
 }