selectTool method
Implementation
void selectTool(Offset point) {
debugPrint('DrawingToolManager.selectTool at $point');
_clearSelection();
// 从上到下检测点击的工具
for (int i = _tools.length - 1; i >= 0; i--) {
final tool = _tools[i];
if (tool.isVisible && tool.hitTest(point)) {
_selectedTool = tool;
_selectedTool!.state = DrawingToolState.selected;
onToolSelected?.call(_selectedTool);
debugPrint('选中工具: ${tool.type}, id: ${tool.id}');
_notifyToolsChanged();
break;
}
}
}