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

JKQTPlotter ScribbleEvent Release/Last emitted signal not triggered when right clicked out of plot #137

Closed
Snolandia opened this issue Oct 11, 2024 · 3 comments
Assignees
Labels

Comments

@Snolandia
Copy link
Contributor

Per title, when clicking to drag, scribble event, if you right click while not in the plot, the last signal isnt emitted.

I fixed it in my fork by:

jkqtplotter.cpp
void JKQTPlotter::mousePressEvent(QMouse * event){
firstLine : MouseDragAction prevAction = currentMouseDragAction;

// Then down at the portion of } else if (event->button()==Qt::RightButton){
// I added this portion

    if (prevAction.mode==jkqtpmdaScribbleForEvents){
      mouseDragRectXStart=plotter->p2x(event->pos().x()/magnification);
      mouseDragRectYStart=plotter->p2y((event->pos().y()-getPlotYOffset())/magnification);
      emit userScribbleClick(mouseDragRectXStart, mouseDragRectYStart, event->modifiers(), false, true);
      }

}

@jkriege2
Copy link
Owner

Could you post a Pull Request with your change?

@jkriege2 jkriege2 self-assigned this Oct 15, 2024
@jkriege2 jkriege2 added the bug label Oct 15, 2024
@Snolandia
Copy link
Contributor Author

#139

@jkriege2
Copy link
Owner

merged. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants