protected internal override void OnMouseLeftButtonDown(object sender, MouseEventArgs e) { if (_manipulationScope != null) { return; // don't know if this ever happens, but it should just continue the current manipulation. } _previousDrawPosition = _documentControl.GetDocumentCoordsAt(e.MouseState.Position); _manipulationScope = _documentControl.Document.Manipulator.BeginManipulation(); _layerEditAccess = _manipulationScope.GetLayerEditAccess(_documentControl.ActiveLayerId); DrawGlyph(_previousDrawPosition); }
protected internal override void OnMouseLeftButtonUp(object sender, MouseEventArgs e) { if (_manipulationScope == null) { return; } if (_hasDrawn) { _manipulationScope.Commit(); } _manipulationScope = null; _layerEditAccess = null; }
public PencilEditTool(DocumentControl documentControl) : base(EditMode.Pencil) { _documentControl = documentControl; _manipulationScope = null; }
public EraserEditTool(DocumentControl documentControl) : base(EditMode.Eraser) { _documentControl = documentControl; _manipulationScope = null; }