mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2025-01-13 01:10:33 +08:00
BugFix
This commit is contained in:
parent
1dc569d534
commit
5b647f24d1
@ -888,6 +888,7 @@ void JKQTPlotter::mouseMoveEvent ( QMouseEvent * event ) {
|
|||||||
|
|
||||||
|
|
||||||
void JKQTPlotter::mousePressEvent ( QMouseEvent * event ){
|
void JKQTPlotter::mousePressEvent ( QMouseEvent * event ){
|
||||||
|
MouseDragAction prevAction = currentMouseDragAction;
|
||||||
currentMouseDragAction.clear();
|
currentMouseDragAction.clear();
|
||||||
mouseDragMarkers.clear();
|
mouseDragMarkers.clear();
|
||||||
|
|
||||||
@ -906,11 +907,18 @@ void JKQTPlotter::mousePressEvent ( QMouseEvent * event ){
|
|||||||
oldImage=image;
|
oldImage=image;
|
||||||
if (currentMouseDragAction.mode==jkqtpmdaScribbleForEvents) emit userScribbleClick(mouseDragRectXStart, mouseDragRectYStart, event->modifiers(), true, false);
|
if (currentMouseDragAction.mode==jkqtpmdaScribbleForEvents) emit userScribbleClick(mouseDragRectXStart, mouseDragRectYStart, event->modifiers(), true, false);
|
||||||
event->accept();
|
event->accept();
|
||||||
} else if (event->button()==Qt::RightButton && event->modifiers()==Qt::NoModifier && contextMenuMode!=jkqtpcmmNoContextMenu) {
|
} else if (event->button()==Qt::RightButton) {
|
||||||
mouseLastClickX=event->pos().x();
|
if (prevAction.mode==jkqtpmdaScribbleForEvents){
|
||||||
mouseLastClickY=event->pos().y();
|
mouseDragRectXStart=plotter->p2x(event->pos().x()/magnification);
|
||||||
openContextMenu(event->pos().x(), event->pos().y());
|
mouseDragRectYStart=plotter->p2y((event->pos().y()-getPlotYOffset())/magnification);
|
||||||
event->accept();
|
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
|
// emit clicked signal, if event occured inside plot only
|
||||||
|
Loading…
Reference in New Issue
Block a user