mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-13 06:49:36 -04:00
increased the free space at the edges at auto-fit, closes #300
This commit is contained in:
parent
350916d1db
commit
cbe8af910c
@ -937,8 +937,9 @@ public class CircuitComponent extends JComponent implements ChangedListener, Lib
|
||||
AffineTransform newTrans = new AffineTransform();
|
||||
if (gr.getMin() != null && getWidth() != 0 && getHeight() != 0) {
|
||||
Vector delta = gr.getMax().sub(gr.getMin());
|
||||
double sx = ((double) getWidth()) / (delta.x + Style.NORMAL.getThickness() * 4);
|
||||
double sy = ((double) getHeight()) / (delta.y + Style.NORMAL.getThickness() * 6);
|
||||
int pad = circuitScrollPanel.getBarWidth();
|
||||
double sx = ((double) getWidth() - pad) / (delta.x + SIZE * 2);
|
||||
double sy = ((double) getHeight() - pad) / (delta.y + SIZE * 2);
|
||||
double s = Math.min(sx, sy);
|
||||
|
||||
|
||||
|
@ -117,4 +117,10 @@ public class CircuitScrollPanel extends JPanel {
|
||||
bar.setVisible(viewMin > circuitMin || viewMax < circuitMax);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the width of the bars
|
||||
*/
|
||||
int getBarWidth() {
|
||||
return vertical.getPreferredSize().width;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user