Esempio n. 1
0
        internal Rect[] GetFloatingObjectsMovingFrameRects(int rowViewport, int columnViewport)
        {
            var allSelectedFloatingObjects = GetAllSelectedFloatingObjects();

            if ((allSelectedFloatingObjects == null) || (allSelectedFloatingObjects.Count == 0))
            {
                return(null);
            }
            List <Rect> list          = new List <Rect>();
            Point       mousePosition = MousePosition;

            new Point(mousePosition.X - _floatingObjectsMovingResizingStartPoint.X, mousePosition.Y - _floatingObjectsMovingResizingStartPoint.Y);
            FloatingObjectLayoutModel cacheFloatingObjectsMovingResizingLayoutModels = GetCacheFloatingObjectsMovingResizingLayoutModels(rowViewport, columnViewport);

            foreach (FloatingObject obj2 in allSelectedFloatingObjects)
            {
                bool flag;
                bool flag2;
                FloatingObjectLayout layout = cacheFloatingObjectsMovingResizingLayoutModels.Find(obj2.Name);
                Point  point2 = new Point(_floatingObjectsMovingResizingStartPoint.X - layout.X, _floatingObjectsMovingResizingStartPoint.Y - layout.Y);
                double x      = mousePosition.X - point2.X;
                double y      = mousePosition.Y - point2.Y;
                KeyboardHelper.GetMetaKeyState(out flag, out flag2);
                if (flag)
                {
                    double num3 = x - layout.X;
                    double num4 = y - layout.Y;
                    if (Math.Abs(num3) > Math.Abs(num4))
                    {
                        y = layout.Y;
                    }
                    else
                    {
                        x = layout.X;
                    }
                }
                list.Add(new Rect(x, y, layout.Width, layout.Height));
            }
            return(list.ToArray());
        }
Esempio n. 2
0
        Rect[] GetFloatingObjectsTopCenterResizingRects(int rowViewport, int columnViewport, Point mousePosition)
        {
            List <Rect> list = new List <Rect>();
            FloatingObjectLayoutModel cacheFloatingObjectsMovingResizingLayoutModels = GetCacheFloatingObjectsMovingResizingLayoutModels(rowViewport, columnViewport);
            FloatingObjectLayoutModel viewportFloatingObjectLayoutModel = GetViewportFloatingObjectLayoutModel(rowViewport, columnViewport);
            Point point = new Point(mousePosition.X - _floatingObjectsMovingResizingStartPoint.X, mousePosition.Y - _floatingObjectsMovingResizingStartPoint.Y);

            foreach (FloatingObject obj2 in _movingResizingFloatingObjects)
            {
                FloatingObjectLayout layout  = cacheFloatingObjectsMovingResizingLayoutModels.Find(obj2.Name);
                FloatingObjectLayout layout2 = viewportFloatingObjectLayoutModel.Find(obj2.Name);
                Point  point2 = new Point(layout.X, layout.Y);
                Point  point3 = new Point(point2.X + point.X, point2.Y + point.Y);
                Point  point4 = new Point(layout2.X + layout2.Width, layout2.Y + layout2.Height);
                double y      = Math.Min(point3.Y, point4.Y);
                double height = Math.Abs((double)(point4.Y - point3.Y));
                double width  = layout2.Width;
                Rect   rect   = new Rect(layout2.X, y, width, height);
                list.Add(rect);
            }
            return(list.ToArray());
        }