[TD]allow multiple primitives in complex selections

This commit is contained in:
wandererfan
2024-05-25 18:48:24 -04:00
committed by WandererFan
parent 3980f5281f
commit ac436f454b
3 changed files with 23 additions and 7 deletions

View File

@@ -39,10 +39,12 @@
#include "QGIPrimPath.h"
#include "PreferencesGui.h"
#include "QGIView.h"
#include "DrawGuiUtil.h"
using namespace TechDrawGui;
using namespace TechDraw;
using DGU = DrawGuiUtil;
QGIPrimPath::QGIPrimPath():
m_width(0),
@@ -251,9 +253,9 @@ void QGIPrimPath::mousePressEvent(QGraphicsSceneMouseEvent *event)
auto parent = dynamic_cast<QGIView *>(parentItem());
if (parent) {
std::vector<Gui::SelectionObject> selection = Gui::Selection().getSelectionEx();
if (selection.size() == 1
&& selection.front().getObject() == parent->getViewObject()) {
if (DGU::findObjectInSelection(selection, *(parent->getViewObject()))) {
// if our parent is already in the selection, then allow addition
// primitives to be selected.
multiselectActivated = true;
event->setModifiers(originalModifiers | Qt::ControlModifier);
}