forked from qt-creator/qt-creator
QmlDesigner: Adjust for scene root transform when finding click pos
Fixes: QDS-8590 Change-Id: I0b8a604c4f78f57a64f4720ab676745c5d0db980 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
#include <QQuickView>
|
#include <QQuickView>
|
||||||
#include <QDropEvent>
|
#include <QDropEvent>
|
||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
|
#include <QMatrix4x4>
|
||||||
|
|
||||||
#include "servernodeinstance.h"
|
#include "servernodeinstance.h"
|
||||||
#include "childrenchangeeventfilter.h"
|
#include "childrenchangeeventfilter.h"
|
||||||
@@ -427,6 +428,9 @@ void Qt5InformationNodeInstanceServer::getNodeAtPos(const QPointF &pos)
|
|||||||
if (!qFuzzyCompare(planePos.z(), -1.f) && qAbs(planePos.x()) < limit && qAbs(planePos.y()) < limit)
|
if (!qFuzzyCompare(planePos.z(), -1.f) && qAbs(planePos.x()) < limit && qAbs(planePos.y()) < limit)
|
||||||
pos3d = {planePos.x(), 0, planePos.y()};
|
pos3d = {planePos.x(), 0, planePos.y()};
|
||||||
}
|
}
|
||||||
|
if (auto rootScene = qobject_cast<QQuick3DNode *>(m_active3DScene))
|
||||||
|
pos3d = rootScene->sceneTransform().inverted().map(pos3d);
|
||||||
|
|
||||||
QVariantList data;
|
QVariantList data;
|
||||||
data.append(instanceId);
|
data.append(instanceId);
|
||||||
data.append(pos3d);
|
data.append(pos3d);
|
||||||
|
|||||||
Reference in New Issue
Block a user