private void ResizeFiguresCreation()
 {
     for (int i = 1; i <= 8; i++)
     {
         FigureResize resizeFigure = new FigureResize(this, (ResizeLocation)i);
     }
 }
Exemple #2
0
        public void SameResize(FigureResize resize)
        {
            OnLayerStartChanging();
            _selection.SameResize(resize);
            _selection.PushTransformToSelectedFigures();
            OnLayerChanged();

            //строим маркеры
            UpdateMarkers();
        }
Exemple #3
0
        /// <summary>
        /// Выравнивание размеров фигур
        /// </summary>
        /// <param name="selection">Текущее выделение фигур</param>
        /// <param name="resize">Направление выравнивания</param>
        public static void SameResize(this Selection selection, FigureResize resize)
        {
            var exists = selection.Count(IsNotSkewAndRotated) > 1;

            if (!exists)
            {
                return;
            }
            var first = selection.FirstOrDefault(IsNotSkewAndRotated);

            if (first == null)
            {
                return;
            }
            var size = Helper.GetSize(first.Transform);

            foreach (var figure in selection.Where(IsNotSkewAndRotated))
            {
                var el = figure.Transform.Matrix.Elements;
                switch (resize)
                {
                case FigureResize.Width:
                    el[0] = size.Width;
                    break;

                case FigureResize.Heigth:
                    el[3] = size.Height;
                    break;

                case FigureResize.Both:
                    el[0] = size.Width;
                    el[3] = size.Height;
                    break;
                }
                figure.Transform.Matrix = new Matrix(el[0], el[1], el[2], el[3], el[4], el[5]);
            }
        }