Exemplo n.º 1
0
        public Context CreateClippedContext()
        {
            Context g = new Context(CurrentUserLayer.Surface);

            Selection.Clip(g);
            return(g);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }