public override void OnMouseUp(Eto.Forms.MouseEventArgs e) { ApplyStyles(); var fill = RipCommands.Create <Commands.Fill>(Document); fill.Point = (Point)e.Location; fill.Border = Handler.Foreground; Handler.AddCommand(fill); Handler.FlushCommands(null); e.Handled = true; }
protected override void FinishCommand(Keys modifiers, IList <Rectangle> updates = null) { if (IsSquare) { var command = RipCommands.Create <Commands.Circle> (Document); command.Point = this.Command.Point; command.Radius = this.Command.Radius.Width; Handler.AddCommand(command, updates); Command = null; } else { base.FinishCommand(modifiers, updates); } }
void DrawBrush(Point location) { ApplyStyles(); var drawUpdates = new List <Rectangle> (); for (int i = 0; i < points; i++) { var x = rnd.Next(width) - width / 2; var y = rnd.Next(width) - width / 2; var pixel = RipCommands.Create <Commands.Pixel> (Document); pixel.Point = new Point(location.X + x, location.Y + y); pixel.SetUndoPoint(i == 0); Handler.AddCommand(pixel, drawUpdates); } Handler.FlushCommands(drawUpdates); }
protected override void Finish(Keys modifiers, IList <Rectangle> updates) { if (IsSquare) { ApplyStyles(); var command = RipCommands.Create <Commands.PieSlice> (Document); command.Point = this.Command.Point; command.Radius = this.Command.Radius.Width; command.StartAngle = this.Command.StartAngle; command.EndAngle = this.Command.EndAngle; Handler.AddCommand(command, updates); Command = null; } else { base.Finish(modifiers, updates); } }
protected override void CreateCommand() { base.Command = RipCommands.Create <T> (Document); }