MCPcopy Create free account
hub / github.com/Card-Forge/forge / scrolled

Method scrolled

forge-gui-mobile/src/forge/Forge.java:1487–1505  ·  view source on GitHub ↗
(float amountX, float amountY)

Source from the content-addressed store, hash-verified

1485 }
1486
1487 @Override
1488 public boolean scrolled(float amountX, float amountY) {
1489 updatePotentialListeners(mouseMovedX, mouseMovedY);
1490
1491 if (KeyInputAdapter.isCtrlKeyDown()) { //zoom in or out based on amount
1492 return zoom(mouseMovedX, mouseMovedY, -Utils.AVG_FINGER_WIDTH * amountY);
1493 }
1494
1495 boolean handled;
1496 if (KeyInputAdapter.isShiftKeyDown()) {
1497 handled = pan(mouseMovedX, mouseMovedY, -Utils.AVG_FINGER_WIDTH * amountY, 0, false);
1498 } else {
1499 handled = pan(mouseMovedX, mouseMovedY, 0, -Utils.AVG_FINGER_HEIGHT * amountY, true);
1500 }
1501 if (panStop(mouseMovedX, mouseMovedY)) {
1502 handled = true;
1503 }
1504 return handled;
1505 }
1506 }
1507 public static void enableControllerListener() {
1508 if (controllerListener == null) {

Callers 1

processEventsMethod · 0.45

Calls 6

isCtrlKeyDownMethod · 0.95
zoomMethod · 0.95
isShiftKeyDownMethod · 0.95
panMethod · 0.95
panStopMethod · 0.95

Tested by

no test coverage detected