fix live canvas clipping

main
jbb01 6 months ago
parent b5acbd1b6c
commit 8ea894cd3e

@ -42,15 +42,19 @@ public final class LiveCanvas implements Canvas {
public @NotNull Thread preview() {
var frame = new JFrame();
frame.setSize(getWidth(), getHeight());
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setContentPane(new JPanel() {
{
setPreferredSize(new Dimension(image.getWidth(), image.getHeight()));
}
@Override
protected void paintComponent(Graphics g) {
g.drawImage(image, 0, 0, null);
}
});
frame.setResizable(false);
frame.pack();
frame.setVisible(true);
var update = Thread.ofVirtual().start(() -> {

Loading…
Cancel
Save