MCPcopy Create free account
hub / github.com/ArtifexSoftware/mupdf / mouseWheelMoved

Method mouseWheelMoved

platform/java/example/Viewer.java:511–530  ·  view source on GitHub ↗
(MouseWheelEvent e)

Source from the content-addressed store, hash-verified

509 }
510
511 public void mouseWheelMoved(MouseWheelEvent e) {
512 int mod = e.getModifiersEx();
513 int rot = e.getWheelRotation();
514 if ((mod & MouseWheelEvent.CTRL_DOWN_MASK) != 0) {
515 if (rot < 0)
516 zoomIn();
517 else
518 zoomOut();
519 } else if ((mod & MouseWheelEvent.SHIFT_DOWN_MASK) != 0) {
520 if (rot < 0)
521 pan(pageCanvas != null ? pageCanvas.getHeight() / -10 : -10, 0);
522 else
523 pan(pageCanvas != null ? pageCanvas.getHeight() / +10 : +10, 0);
524 } else if (mod == 0) {
525 if (rot < 0)
526 pan(0, pageCanvas != null ? pageCanvas.getHeight() / -10 : -10);
527 else
528 pan(0, pageCanvas != null ? pageCanvas.getHeight() / +10 : +10);
529 }
530 }
531
532 protected void editSearchNeedle(int direction) {
533 clearSearch();

Callers

nothing calls this directly

Calls 4

zoomInMethod · 0.95
zoomOutMethod · 0.95
panMethod · 0.95
getHeightMethod · 0.45

Tested by

no test coverage detected