Fix issue #112, NPE in RocketFigure3d mouseDragged()
The component can pick up a mouse drag event without a mouse press event if the mous is clicked and dragged while a modal dialog is open. The running simulations progress bar dialog is an example. To fix, do not process a mouse drag if a mouse press has not been recorded.
This commit is contained in:
parent
265fdfe05e
commit
0bc139fd05
@ -234,6 +234,10 @@ public class RocketFigure3d extends JPanel implements GLEventListener {
|
||||
|
||||
@Override
|
||||
public void mouseDragged(final MouseEvent e) {
|
||||
//You can get a drag without a press while a modal dialog is shown
|
||||
if (pressEvent == null)
|
||||
return;
|
||||
|
||||
int dx = lastX - e.getX();
|
||||
int dy = lastY - e.getY();
|
||||
lastX = e.getX();
|
||||
|
Loading…
x
Reference in New Issue
Block a user