mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-26 14:31:02 -04:00
fixed flicker if component tree view is enabled or disabled.
This commit is contained in:
parent
228e990557
commit
a0a74a7dab
@ -324,7 +324,7 @@ public class Main extends JFrame implements ClosingWindowListener.ConfirmSave, E
|
||||
getContentPane().add(circuitComponent);
|
||||
componentOnPane = circuitComponent;
|
||||
}
|
||||
pack();
|
||||
revalidate();
|
||||
});
|
||||
|
||||
toolBar.add(viewHelp.createJButtonNoText());
|
||||
|
@ -438,6 +438,9 @@ public class CircuitComponent extends JComponent implements Circuit.ChangedListe
|
||||
|| getWidth() != buffer.getWidth()
|
||||
|| getHeight() != buffer.getHeight();
|
||||
|
||||
if (needsNewBuffer && !isManualScale)
|
||||
fitCircuit();
|
||||
|
||||
if (hasChanged
|
||||
|| needsNewBuffer
|
||||
|| highLighted.size() != highlightedPaintedSize) {
|
||||
@ -455,7 +458,7 @@ public class CircuitComponent extends JComponent implements Circuit.ChangedListe
|
||||
circuit.drawTo(gr, highLighted, modelSync);
|
||||
highlightedPaintedSize = highLighted.size();
|
||||
hasChanged = false;
|
||||
// LOGGER.debug("repaint: " + Long.toString(System.currentTimeMillis() - time) + "ms");
|
||||
// System.out.println("repaint: " + Long.toString(System.currentTimeMillis() - time) + "ms");
|
||||
}
|
||||
|
||||
g.drawImage(buffer, 0, 0, null);
|
||||
|
Loading…
x
Reference in New Issue
Block a user