Esempio n. 1
0
        protected virtual void OnUIDragBegin(object sender, MouseEventArgs e)
        {
            if (!e.Handled && (e.Source is UIElement))
            {
                PointDouble mouseCenterPt = BrushToolBase <TDerived, TChanges, TUI> .GetMouseCenterPt(e.GetPosition(this.UI), base.CanvasView.CanvasHairWidth);

                BrushInputPoint point = new BrushInputPoint(mouseCenterPt);
                if ((this.State == TransactedToolState.Idle) && !this.mouseInputDrawingAgent.IsActive)
                {
                    BrushInputPoint[] inputPoints    = new BrushInputPoint[] { point };
                    TChanges          initialChanges = this.CreateChanges(base.DrawingSettingsValues, inputPoints, e.RightButton);
                    base.BeginDrawing(this.mouseInputDrawingAgent, initialChanges);
                }
            }
        }
Esempio n. 2
0
 protected static PointDouble GetMouseCenterPt(PointDouble mouseTopLeftPt, double hairWidth) =>
 BrushToolBase <TDerived, TChanges, TUI> .GetMouseCoverageRect(mouseTopLeftPt, hairWidth).Center;
Esempio n. 3
0
        protected virtual void OnUIDragMove(object sender, MouseEventArgs e)
        {
            double canvasHairWidth;

            if ((!e.Handled && (e.Source is UIElement)) && ((this.State == TransactedToolState.Drawing) && this.mouseInputDrawingAgent.IsActive))
            {
                IList <PointDouble> intermediatePoints = e.GetIntermediatePoints(this.UI);
                canvasHairWidth = base.CanvasView.CanvasHairWidth;
                IList <BrushInputPoint> inputPoints = intermediatePoints.Select <PointDouble, PointDouble>(pt => BrushToolBase <TDerived, TChanges, TUI> .GetMouseCenterPt(pt, canvasHairWidth)).Select <PointDouble, BrushInputPoint>(pt => new BrushInputPoint(pt));
                TChanges changes = this.mouseInputDrawingAgent.TransactionToken.Changes;
                TChanges local2  = this.CreateChanges(changes, inputPoints);
                this.mouseInputDrawingAgent.TransactionToken.Changes = local2;
            }
        }