Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 4
0
 protected void OnWorldChange()
 {
     WorldChange?.Invoke();
 }