Exemplo n.º 1
0
 public void SetStrategy(SelectStrategy s)
 {
     lock (Locker)
     {
         SelectStrategy = s;
         s.SetZoomController(this);
     }
 }
Exemplo n.º 2
0
        private void DragDetector_MouseUp(Point obj)
        {
            if (!SelectStrategy.IsRectBigEnough(coverRect, Mapper))
            {
                UpdateView();
            }
            else
            {
                var left   = Mapper.GetCoordinateX(coverRect.Left);
                var right  = Mapper.GetCoordinateX(coverRect.Right);
                var top    = Mapper.GetCoordinateY(coverRect.Top);
                var bottom = Mapper.GetCoordinateY(coverRect.Bottom);
                SetMapperRange(left, right, top, bottom);
            }

            //此处必须清零coverRect,原因是:当鼠标只做点击不拖动时,coverRect会保留上次放缩时计算的CoverRect值,因此会通过IsRectBigEnough的校验
            coverRect = new Rectangle(0, 0, 0, 0);
            return;
        }
Exemplo n.º 3
0
 private void DragDetector_MouseDrag(Point arg1, Point arg2)
 {
     coverRect = SelectStrategy.CalRect(arg1, arg2);
     UpdateView();
 }
Exemplo n.º 4
0
 public ZoomController(SelectStrategy selectStrategy)
 {
     SelectStrategy = selectStrategy;
     SelectStrategy.SetZoomController(this);
 }
Exemplo n.º 5
0
 protected override void DrawElement(RenderTarget rt)
 {
     SelectStrategy.DrawZoomView(coverRect.ToRectF(), rt, fillBrush, frameBrush, 2);
 }