Example #1
0
        public Context CreateClippedContext()
        {
            Context g = new Context(CurrentUserLayer.Surface);

            Selection.Clip(g);
            return(g);
        }
Example #2
0
        public void FinishSelection()
        {
            // We don't have an uncommitted layer, abort
            if (!ShowSelectionLayer)
            {
                return;
            }

            FinishPixelsHistoryItem hist = new FinishPixelsHistoryItem();

            hist.TakeSnapshot();

            Layer layer = SelectionLayer;

            using (Cairo.Context g = new Cairo.Context(CurrentUserLayer.Surface)) {
                selection.Clip(g);
                layer.DrawWithOperator(g, layer.Surface, Operator.Source, 1.0f, true);
            }

            DestroySelectionLayer();
            Workspace.Invalidate();

            Workspace.History.PushNewItem(hist);
        }
Example #3
0
        public void FinishSelection()
        {
            // We don't have an uncommitted layer, abort
            if (!Layers.ShowSelectionLayer)
            {
                return;
            }

            FinishPixelsHistoryItem hist = new FinishPixelsHistoryItem();

            hist.TakeSnapshot();

            Layer layer = Layers.SelectionLayer;

            using (Cairo.Context g = new Cairo.Context(Layers.CurrentUserLayer.Surface)) {
                selection.Clip(g);
                layer.Draw(g);
            }

            Layers.DestroySelectionLayer();
            Workspace.Invalidate();

            Workspace.History.PushNewItem(hist);
        }