예제 #1
0
        public override void UpdateToolbarSettings(ShapeEngine engine)
        {
            if (engine != null && engine.ShapeType == ShapeTypes.RoundedLineSeries)
            {
                RoundedLineEngine rLEngine = (RoundedLineEngine)engine;

                Radius = rLEngine.Radius;

                base.UpdateToolbarSettings(engine);
            }
        }
예제 #2
0
        protected override ShapeEngine CreateShape(bool ctrlKey, bool clickedOnControlPoint, PointD prevSelPoint)
        {
            Document doc = PintaCore.Workspace.ActiveDocument;

            ShapeEngine newEngine = new RoundedLineEngine(doc.CurrentUserLayer, null, Radius, owner.UseAntialiasing,
                                                          BaseEditEngine.OutlineColor, BaseEditEngine.FillColor, owner.EditEngine.BrushWidth);

            AddRectanglePoints(ctrlKey, clickedOnControlPoint, newEngine, prevSelPoint);

            //Set the new shape's DashPattern option.
            newEngine.DashPattern = dash_pattern_box.comboBox.ComboBox.ActiveText;

            return(newEngine);
        }
예제 #3
0
        /// <summary>
        /// Converts the ShapeEngine instance into a new instance of a different ShapeEngine (child) type, copying the common data.
        /// </summary>
        /// <param name="newShapeType">The new ShapeEngine type to create.</param>
        /// <param name="shapeIndex">The index to insert the ShapeEngine clone into SEngines at.
        /// This ensures that the clone is as transparent as possible.</param>
        /// <returns>A new ShapeEngine instance of the specified type with the common data copied over.</returns>
        public ShapeEngine GenericClone(BaseEditEngine.ShapeTypes newShapeType, int shapeIndex)
        {
            //Remove the old ShapeEngine instance.
            BaseEditEngine.SEngines.Remove(this);

            ShapeEngine clonedEngine;

            switch (newShapeType)
            {
            case BaseEditEngine.ShapeTypes.ClosedLineCurveSeries:
                clonedEngine = new LineCurveSeriesEngine(parentLayer, DrawingLayer, newShapeType, AntiAliasing, true,
                                                         OutlineColor, FillColor, BrushWidth);

                break;

            case BaseEditEngine.ShapeTypes.Ellipse:
                clonedEngine = new EllipseEngine(parentLayer, DrawingLayer, AntiAliasing, OutlineColor, FillColor, BrushWidth);

                break;

            case BaseEditEngine.ShapeTypes.RoundedLineSeries:
                clonedEngine = new RoundedLineEngine(parentLayer, DrawingLayer, RoundedLineEditEngine.DefaultRadius,
                                                     AntiAliasing, OutlineColor, FillColor, BrushWidth);

                break;

            default:
                //Defaults to OpenLineCurveSeries.
                clonedEngine = new LineCurveSeriesEngine(parentLayer, DrawingLayer, newShapeType, AntiAliasing, false,
                                                         OutlineColor, FillColor, BrushWidth);

                break;
            }

            clonedEngine.ControlPoints = ControlPoints.Select(i => i.Clone()).ToList();

            //Don't clone the GeneratedPoints or OrganizedPoints, as they will be calculated.

            clonedEngine.DashPattern = DashPattern;

            //Add the new ShapeEngine instance at the specified index to ensure as transparent of a cloning as possible.
            BaseEditEngine.SEngines.Insert(shapeIndex, clonedEngine);

            return(clonedEngine);
        }
예제 #4
0
		protected override ShapeEngine CreateShape(bool ctrlKey, bool clickedOnControlPoint, PointD prevSelPoint)
		{
			Document doc = PintaCore.Workspace.ActiveDocument;

			ShapeEngine newEngine = new RoundedLineEngine(doc.CurrentUserLayer, null, Radius, owner.UseAntialiasing,
				BaseEditEngine.OutlineColor, BaseEditEngine.FillColor, owner.EditEngine.BrushWidth);

			AddRectanglePoints(ctrlKey, clickedOnControlPoint, newEngine, prevSelPoint);

			//Set the new shape's DashPattern option.
			newEngine.DashPattern = dash_pattern_box.comboBox.ComboBox.ActiveText;

			return newEngine;
		}
예제 #5
0
 public RoundedLineEngine (RoundedLineEngine src) : base (src)
 {
     Radius = src.Radius;
 }
예제 #6
0
 public RoundedLineEngine(RoundedLineEngine src) : base(src)
 {
     Radius = src.Radius;
 }