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

Method fitPage

platform/java/example/Viewer.java:689–699  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

687 }
688
689 protected void fitPage() {
690 Dimension size = pageScroll.getSize();
691 float width = bbox != null ? bbox.x1 - bbox.x0 : 0;
692 float height = bbox != null ? bbox.y1 - bbox.y0 : 0;
693 float pageAspect = (width == 0 || height == 0) ? 0 : (width / height);
694 float canvasAspect = (float) size.width / (float) size.height;
695 if (pageAspect > canvasAspect)
696 fitWidth();
697 else
698 fitHeight();
699 }
700
701 protected void rotate(int change) {
702 int newRotate = rotate + change;

Callers 1

canvasKeyTypedMethod · 0.95

Calls 2

fitWidthMethod · 0.95
fitHeightMethod · 0.95

Tested by

no test coverage detected