コード例 #1
0
ファイル: MoveSelectedTool.cs プロジェクト: ywscr/Pinta
        protected override void OnUpdateTransform(Matrix transform)
        {
            base.OnUpdateTransform(transform);

            Document doc = PintaCore.Workspace.ActiveDocument;

            doc.Selection.Dispose();
            doc.Selection         = original_selection.Transform(transform);
            doc.Selection.Visible = true;

            doc.SelectionLayer.Transform.InitMatrix(original_transform);
            doc.SelectionLayer.Transform.Multiply(transform);

            PintaCore.Workspace.Invalidate();
        }
コード例 #2
0
        protected override void OnUpdateTransform(Matrix transform)
        {
            base.OnUpdateTransform(transform);

            List <List <IntPoint> > newSelectionPolygons = DocumentSelection.Transform(original_selection, transform);

            Document doc = PintaCore.Workspace.ActiveDocument;

            doc.Selection.SelectionClipper.Clear();
            doc.Selection.SelectionPolygons = newSelectionPolygons;
            doc.Selection.MarkDirty();

            doc.ShowSelection = true;

            PintaCore.Workspace.Invalidate();
        }
コード例 #3
0
        protected override void OnUpdateTransform(Matrix transform)
        {
            base.OnUpdateTransform(transform);

            List <List <IntPoint> > newSelectionPolygons = DocumentSelection.Transform(original_selection, transform);

            Document doc = PintaCore.Workspace.ActiveDocument;

            doc.Selection.SelectionClipper.Clear();
            doc.Selection.SelectionPolygons = newSelectionPolygons;
            using (var g = new Cairo.Context(doc.CurrentUserLayer.Surface)) {
                doc.Selection.SelectionPath = g.CreatePolygonPath(DocumentSelection.ConvertToPolygonSet(newSelectionPolygons));
                g.FillRule = FillRule.EvenOdd;
                g.AppendPath(doc.Selection.SelectionPath);
            }

            doc.ShowSelection = true;

            PintaCore.Workspace.Invalidate();
        }