This commit is contained in:
Jonathan 2024-10-15 13:26:57 -07:00
parent 1dc569d534
commit 5b647f24d1

View File

@ -888,6 +888,7 @@ void JKQTPlotter::mouseMoveEvent ( QMouseEvent * event ) {
void JKQTPlotter::mousePressEvent ( QMouseEvent * event ){
MouseDragAction prevAction = currentMouseDragAction;
currentMouseDragAction.clear();
mouseDragMarkers.clear();
@ -906,12 +907,19 @@ void JKQTPlotter::mousePressEvent ( QMouseEvent * event ){
oldImage=image;
if (currentMouseDragAction.mode==jkqtpmdaScribbleForEvents) emit userScribbleClick(mouseDragRectXStart, mouseDragRectYStart, event->modifiers(), true, false);
event->accept();
} else if (event->button()==Qt::RightButton && event->modifiers()==Qt::NoModifier && contextMenuMode!=jkqtpcmmNoContextMenu) {
} else if (event->button()==Qt::RightButton) {
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);
}
if(event->modifiers()==Qt::NoModifier && contextMenuMode!=jkqtpcmmNoContextMenu){
mouseLastClickX=event->pos().x();
mouseLastClickY=event->pos().y();
openContextMenu(event->pos().x(), event->pos().y());
event->accept();
}
}
// emit clicked signal, if event occured inside plot only
if ( (event->pos().x()/magnification>=plotter->getInternalPlotBorderLeft()) && (event->pos().x()/magnification<=plotter->getPlotWidth()+plotter->getInternalPlotBorderLeft()) &&