[fix] adjusted scroll increment in FinPointFigure to a reasonable number

This commit is contained in:
Daniel_M_Williams 2020-07-12 14:15:26 -04:00
parent 8162e81ac0
commit 5696ad910b

View File

@ -100,8 +100,13 @@ public class ScaleScrollPane extends JScrollPane
this.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY)); this.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); getHorizontalScrollBar().setUnitIncrement(50);
//getHorizontalScrollBar().setBlockIncrement(viewport.getWidth()); // the default value is good
setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
getVerticalScrollBar().setUnitIncrement(50);
//getVerticalScrollBar().setBlockIncrement(viewport.getHeight()); // the default value is good
viewport.addMouseListener(this); viewport.addMouseListener(this);
viewport.addMouseMotionListener(this); viewport.addMouseMotionListener(this);
@ -322,9 +327,8 @@ public class ScaleScrollPane extends JScrollPane
// this function doesn't reliably update all the time, so we'll draw everything for the entire canvas, // this function doesn't reliably update all the time, so we'll draw everything for the entire canvas,
// and let the JVM drawing algorithms figure out what should be drawn. // and let the JVM drawing algorithms figure out what should be drawn.
// Rectangle area = viewport.getViewRect();
Rectangle area = ScaleScrollPane.this.getViewport().getViewRect();
// Fill area with background color // Fill area with background color
g2.setColor(getBackground()); g2.setColor(getBackground());
g2.fillRect(area.x, area.y, area.width, area.height + 100); g2.fillRect(area.x, area.y, area.width, area.height + 100);