Skip to content

Commit

Permalink
Fixed Right click press position (#284)
Browse files Browse the repository at this point in the history
Signed-off-by: ahcorde <ahcorde@gmail.com>
  • Loading branch information
ahcorde committed Sep 21, 2021
1 parent 72e1066 commit 27f9f68
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/plugins/minimal_scene/MinimalScene.cc
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ void IgnRenderer::BroadcastRightClick()

events::RightClickToScene rightClickToSceneEvent(pos);
App()->sendEvent(App()->findChild<MainWindow *>(), &rightClickToSceneEvent);
events::RightClickOnScene rightClickOnSceneEvent(this->dataPtr->mouseEvent);
App()->sendEvent(App()->findChild<MainWindow *>(), &rightClickOnSceneEvent);
}


Expand Down Expand Up @@ -1051,9 +1053,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);
Expand Down Expand Up @@ -1083,6 +1085,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);
Expand Down

0 comments on commit 27f9f68

Please sign in to comment.