void hdCreationTool::mouseDown(hdMouseEvent &event) { hdAbstractTool::mouseDown(event); if(event.LeftDown()) { event.getView()->getDrawing()->add(figurePrototype); int x = event.GetPosition().x, y = event.GetPosition().y; figurePrototype->moveTo(event.getView()->getIdx(), x, y); event.getView()->getDrawing()->clearSelection(); event.getView()->getDrawing()->addToSelection(figurePrototype); } }
void hdSelectAreaTool::mouseDown(hdMouseEvent &event) { hdAbstractTool::mouseDown(event); if(!event.ShiftDown()) { event.getView()->getDrawing()->clearSelection(); } if(event.LeftDown()) { int x = event.GetPosition().x, y = event.GetPosition().y; selectionRect.x = x; selectionRect.y = y; selectionRect.width = 0; selectionRect.height = 0; drawSelectionRect(event.getView()); } }
void hdDragTrackerTool::mouseDown(hdMouseEvent &event) { hdAbstractTool::mouseDown(event); if(event.LeftDown()) { int x = event.GetPosition().x, y = event.GetPosition().y; setLastCoords(x, y); if(event.m_shiftDown) { event.getView()->getDrawing()->toggleSelection(anchorFigure); } else if(!event.getView()->getDrawing()->isFigureSelected(anchorFigure)) { event.getView()->getDrawing()->clearSelection(); event.getView()->getDrawing()->addToSelection(anchorFigure); } } }