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