src/tools/selecttool.cpp

changeset 121
000781318c36
parent 111
1f42c03fafca
child 126
a7c720aff97c
--- a/src/tools/selecttool.cpp	Wed Jul 28 13:22:51 2021 +0300
+++ b/src/tools/selecttool.cpp	Fri Jul 30 01:28:39 2021 +0300
@@ -15,14 +15,21 @@
 	return result;
 }
 
-bool SelectTool::mouseClick(Document* document, Canvas* canvas)
+bool SelectTool::mouseClick(Document* document, Canvas* canvas, QMouseEvent* event)
 {
-	static_cast<void>(document);
-	const ldraw::id_t highlighted = canvas->getHighlightedObject();
-	canvas->clearSelection();
-	if (highlighted != ldraw::NULL_ID)
+	if (event->button() == Qt::LeftButton)
 	{
-		canvas->addToSelection(highlighted);
+		static_cast<void>(document);
+		const ldraw::id_t highlighted = canvas->getHighlightedObject();
+		canvas->clearSelection();
+		if (highlighted != ldraw::NULL_ID)
+		{
+			canvas->addToSelection(highlighted);
+		}
+		return true;
 	}
-	return true;
+	else
+	{
+		return false;
+	}
 }

mercurial