Ejemplo n.º 1
0
        /// <summary>
        /// A history item for when shapes are finalized.
        /// </summary>
        /// <param name="passedEE">The EditEngine being used.</param>
        /// <param name="icon">The history item's icon.</param>
        /// <param name="text">The history item's title.</param>
        /// <param name="passedUserSurface">The stored UserLayer surface.</param>
        /// <param name="passedUserLayer">The UserLayer being modified.</param>
        /// <param name="passedSelectedPointIndex">The selected point's index.</param>
        /// <param name="passedSelectedShapeIndex">The selected point's shape index.</param>
        /// <param name="passedRedrawEverything">Whether every shape should be redrawn when undoing (e.g. finalization).</param>
        public ShapesHistoryItem(BaseEditEngine passedEE, string icon, string text, ImageSurface passedUserSurface, UserLayer passedUserLayer,
                                 int passedSelectedPointIndex, int passedSelectedShapeIndex, bool passedRedrawEverything) : base(icon, text)
        {
            ee = passedEE;

            userLayer = passedUserLayer;


            userSurfaceDiff = SurfaceDiff.Create(passedUserSurface, userLayer.Surface, true);

            if (userSurfaceDiff == null)
            {
                userSurface = passedUserSurface;
            }
            else
            {
                (passedUserSurface as IDisposable).Dispose();
            }


            sEngines           = BaseEditEngine.SEngines.PartialClone();
            selectedPointIndex = passedSelectedPointIndex;
            selectedShapeIndex = passedSelectedShapeIndex;

            redrawEverything = passedRedrawEverything;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// A history item for when curves are finalized.
        /// </summary>
        /// <param name="icon">The history item's icon.</param>
        /// <param name="text">The history item's title.</param>
        /// <param name="passedUserSurface">The stored UserLayer surface.</param>
        /// <param name="passedUserLayer">The UserLayer being modified.</param>
        /// <param name="passedSelectedPointIndex">The selected point's index.</param>
        /// <param name="passedSelectedPointCurveIndex">The selected point's curve index.</param>
        public CurvesHistoryItem(string icon, string text, ImageSurface passedUserSurface, UserLayer passedUserLayer,
                                 int passedSelectedPointIndex, int passedSelectedPointCurveIndex) : base(icon, text)
        {
            userLayer = passedUserLayer;


            user_surface_diff = SurfaceDiff.Create(passedUserSurface, userLayer.Surface, true);

            if (user_surface_diff == null)
            {
                userSurface = passedUserSurface;
            }
            else
            {
                (passedUserSurface as IDisposable).Dispose();
            }


            cEngines                = Pinta.Tools.LineCurveTool.cEngines.PartialClone();
            selectedPointIndex      = passedSelectedPointIndex;
            selectedPointCurveIndex = passedSelectedPointCurveIndex;
        }