Example #1
0
        private void Swap()
        {
            // Grab the original surface
            ImageSurface surf = userLayer.TextLayer.Layer.Surface;

            if (text_surface_diff != null)
            {
                text_surface_diff.ApplyAndSwap(surf);
                PintaCore.Workspace.Invalidate(text_surface_diff.GetBounds());
            }
            else
            {
                // Undo to the "old" surface
                userLayer.TextLayer.Layer.Surface = textSurface;

                // Store the original surface for Redo
                textSurface = surf;
            }



            // Grab the original surface
            surf = userLayer.Surface;

            if (user_surface_diff != null)
            {
                user_surface_diff.ApplyAndSwap(surf);
                PintaCore.Workspace.Invalidate(user_surface_diff.GetBounds());
            }
            else
            {
                // Undo to the "old" surface
                userLayer.Surface = userSurface;

                // Store the original surface for Redo
                userSurface = surf;
            }



            //Redraw everything since surfaces were swapped.
            PintaCore.Workspace.Invalidate();



            //Store the old text data temporarily.
            TextEngine oldTEngine = tEngine;

            Gdk.Rectangle oldTextBounds = textBounds;

            //Swap half of the data.
            tEngine    = userLayer.tEngine;
            textBounds = userLayer.textBounds;

            //Swap the other half.
            userLayer.tEngine    = oldTEngine;
            userLayer.textBounds = oldTextBounds;
        }
Example #2
0
        private void Swap()
        {
            // Grab the original surface
            ImageSurface surf = PintaCore.Layers[layer_index].Surface;

            if (surface_diff != null)
            {
                surface_diff.ApplyAndSwap(surf);
                PintaCore.Workspace.Invalidate(surface_diff.GetBounds());
            }
            else
            {
                // Undo to the "old" surface
                PintaCore.Layers[layer_index].Surface = old_surface;

                // Store the original surface for Redo
                old_surface = surf;

                PintaCore.Workspace.Invalidate();
            }
        }