Skip to content

Commit

Permalink
Cherry pick 417b924 77a9582
Browse files Browse the repository at this point in the history
to move PR 8668 to the release-4.19.8 branch

LayoutEditor:No minimal zoom

(cherry picked from commit 417b924)
  • Loading branch information
geowar1 authored and bobjacobsen committed Jun 15, 2020
1 parent d9bcf7e commit 234a030
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions java/src/jmri/jmrit/display/layoutEditor/LayoutEditor.java
Expand Up @@ -2042,14 +2042,13 @@ private void selectZoomMenuItem(double zoomFactor) {
* @return the new scale amount (not necessarily the same as zoomFactor)
*/
public double setZoom(double zoomFactor) {
// re-calculate minZoom (so panel never smaller than view)
JScrollPane scrollPane = getPanelScrollPane();
Rectangle2D scrollBounds = scrollPane.getViewportBorderBounds();
Rectangle2D panelBounds = getPanelBounds();
Dimension panelSize = MathUtil.getSize(panelBounds);
minZoom = Math.min(scrollBounds.getWidth() / panelSize.getWidth(),
scrollBounds.getHeight() / panelSize.getHeight());
enableZoomMenuItem(minZoom);
//minZoom = Math.min(scrollBounds.getWidth() / panelSize.getWidth(),
// scrollBounds.getHeight() / panelSize.getHeight());
//enableZoomMenuItem(minZoom);

double newZoom = MathUtil.pin(zoomFactor, minZoom, maxZoom);
selectZoomMenuItem(newZoom);
Expand Down

0 comments on commit 234a030

Please sign in to comment.