From bde1977b4600602fb63f08d74cfbeeaf5bd3919b Mon Sep 17 00:00:00 2001 From: ahcorde Date: Thu, 16 Sep 2021 12:34:20 +0200 Subject: [PATCH 1/2] Fixed Right click press position Signed-off-by: ahcorde --- src/plugins/minimal_scene/MinimalScene.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/minimal_scene/MinimalScene.cc b/src/plugins/minimal_scene/MinimalScene.cc index 76347c2f7..9ded7637c 100644 --- a/src/plugins/minimal_scene/MinimalScene.cc +++ b/src/plugins/minimal_scene/MinimalScene.cc @@ -248,6 +248,8 @@ void IgnRenderer::BroadcastRightClick() events::RightClickToScene rightClickToSceneEvent(pos); App()->sendEvent(App()->findChild(), &rightClickToSceneEvent); + events::RightClickOnScene rightClickOnSceneEvent(this->dataPtr->mouseEvent); + App()->sendEvent(App()->findChild(), &rightClickOnSceneEvent); } @@ -841,6 +843,7 @@ void RenderWindowItem::keyReleaseEvent(QKeyEvent *_e) void RenderWindowItem::mouseReleaseEvent(QMouseEvent *_e) { this->dataPtr->mouseEvent = convert(*_e); + this->dataPtr->mouseEvent.SetPressPos(_e->pos().x(), _e->pos().y()); this->dataPtr->renderThread->ignRenderer.NewMouseEvent( this->dataPtr->mouseEvent); From 29e5790d510cd10781fa52da3b3fbba3bccd053b Mon Sep 17 00:00:00 2001 From: ahcorde Date: Tue, 21 Sep 2021 15:10:04 +0200 Subject: [PATCH 2/2] Fixed mouse press pos Signed-off-by: ahcorde --- src/plugins/minimal_scene/MinimalScene.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/minimal_scene/MinimalScene.cc b/src/plugins/minimal_scene/MinimalScene.cc index 0533d4af5..7bb85c470 100644 --- a/src/plugins/minimal_scene/MinimalScene.cc +++ b/src/plugins/minimal_scene/MinimalScene.cc @@ -1044,9 +1044,9 @@ void RenderWindowItem::OnDropped(const QString &_drop, ///////////////////////////////////////////////// void RenderWindowItem::mousePressEvent(QMouseEvent *_e) { - auto event = convert(*_e); - event.SetPressPos(event.Pos()); - this->dataPtr->mouseEvent = event; + auto pressPos = this->dataPtr->mouseEvent.PressPos(); + this->dataPtr->mouseEvent = convert(*_e); + this->dataPtr->mouseEvent.SetPressPos(pressPos); this->dataPtr->renderThread->ignRenderer.NewMouseEvent( this->dataPtr->mouseEvent);