()
| 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; |
no test coverage detected