442443444445446447448449450451452
} } if (scale > 0) { graphComponent.zoomTo(scale, graphComponent.isCenterZoom()); } } } }
260261262263264265266267268269270
try { zoom = zoom.replace("%", ""); double scale = Math.min(16, Math.max(0.01, Double.parseDouble(zoom) / 100)); graphComponent.zoomTo(scale, graphComponent .isCenterZoom()); } catch (Exception ex) { JOptionPane.showMessageDialog(editor, ex
163164165166167168169170171172173
436437438439440441442443444445446
8889909192939495969798
double zoomRatio = downZoom / zoomTween.getPosition(); // new distances from down point to center. float newX = (float) (downCameraX + dx - dx * zoomRatio); float newY = (float) (downCameraY + dy - dy * zoomRatio); Camera cam = getCamera(); cam.zoomTo(zoomTween.getPosition()); cam.nudgeTo(newX, newY); cam.fforward(); } }