+ // Note: One would expect inE.isMetaDown() to give information about whether this is a
+ // drag with the right mouse button or not - but since java 9 this is buggy,
+ // so we use the beautifully-named getModifiersEx() instead.
+ // And logically BUTTON3 refers to the secondary mouse button, not the tertiary one!
+ final boolean isRightDrag = (inE.getModifiersEx() & InputEvent.BUTTON3_DOWN_MASK) > 0;
+ if (isRightDrag)
+ {
+ // Right-click and drag - update rectangle
+ _drawMode = MODE_ZOOM_RECT;
+ if (_dragFromX == -1) {
+ _dragFromX = inE.getX();
+ _dragFromY = inE.getY();
+ }
+ _dragToX = inE.getX();
+ _dragToY = inE.getY();
+ repaint();
+ }
+ else