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

Method zoomToDPI

platform/java/example/Viewer.java:619–647  ·  view source on GitHub ↗
(int newDPI)

Source from the content-addressed store, hash-verified

617 }
618
619 protected void zoomToDPI(int newDPI) {
620 if (newDPI == 0)
621 newDPI = screenDPI;
622 if (newDPI < MIN_ZOOM_DPI)
623 newDPI = MIN_ZOOM_DPI;
624 if (newDPI > MAX_ZOOM_DPI)
625 newDPI = MAX_ZOOM_DPI;
626
627 if (newDPI == currentDPI)
628 return;
629
630 int level = findExactZoomLevel(newDPI);
631 if (level < 0) {
632 if (customZoom)
633 zoomChoice.remove(0);
634 customZoom = true;
635 zoomChoice.insert(String.valueOf(newDPI), 0);
636 zoomChoice.select(0);
637 } else {
638 if (customZoom) {
639 customZoom = false;
640 zoomChoice.remove(0);
641 }
642 zoomChoice.select(level);
643 }
644
645 currentDPI = newDPI;
646 render();
647 }
648
649 protected void zoomToLevel(int level) {
650 if (level < 0)

Callers 3

canvasKeyTypedMethod · 0.95
zoomToLevelMethod · 0.95
zoomToScaleMethod · 0.95

Calls 5

findExactZoomLevelMethod · 0.95
renderMethod · 0.95
valueOfMethod · 0.80
removeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected