Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Right click press position #284

Merged
merged 5 commits into from
Sep 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do the same for the left click?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thanks. But it's strange that these are not done in the same place. The right click is in Broadcast while the left click is in HandleMouseViewControl. Do you know why they're not handled the same way?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can sort this out later, let's get this PR in

}


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());
chapulina marked this conversation as resolved.
Show resolved Hide resolved

this->dataPtr->renderThread->ignRenderer.NewMouseEvent(
this->dataPtr->mouseEvent);
Expand Down