Beispiel #1
0
        public override void Trigger(EditableView.ClickPosition.Sources source, EditableView pnlView, Transaction transaction)
        {
            Shape shape = CurrentPage.SelectedShapes.First();

            transaction.Edit(shape);
            Shape.VerbResult result = shape.OtherVerb(new EditableView.ClickPosition(CurrentPage.SelectedPath.Position, CurrentPage, pnlView.Zoom, Shape.SnapModes.Off, Shape.SnapModes.Off, pnlView, source), Code);
            if (result == Shape.VerbResult.Unexpected || result == Shape.VerbResult.Unchanged || result == Shape.VerbResult.Rejected)
            {
                transaction.Cancel();
            }
            pnlView.ForceUpdateGrabSpots();
        }
Beispiel #2
0
        public override void Trigger(EditableView.ClickPosition.Sources source, EditableView pnlView, Transaction transaction)
        {
            bool changed = false;

            foreach (Shape shape in CurrentPage.SelectedShapes)
            {
                transaction.Edit(shape);                 // must add to Tx before Tidy to get the previous state.  Only after Tidy do we know if it actually changed
                if (shape.Tidy(Mode, CurrentPage))
                {
                    changed = true;
                }
                else
                {
                    transaction.Disregard(shape);
                }
            }
            if (changed)
            {
                pnlView.ForceUpdateGrabSpots();
            }
            // main invalidation done automatically by tx
        }