Skip to content

Commit b3c9bb6

Browse files
committed
lib/graphics: fix padding update
The image is now cached in the state, so re-painting the component is not enough anymore.
1 parent 3f4377c commit b3c9bb6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/src/main/java/jtamaro/graphic/GuiGraphicCanvas.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ public GuiGraphicCanvas(RenderOptions renderOptions) {
6464
super();
6565
this.state = new State();
6666
this.renderOptions = renderOptions;
67-
renderOptions.addRenderOptionsListener(this::repaint);
67+
renderOptions.addRenderOptionsListener(() -> {
68+
this.state = new State(state.graphic, graphicToImage(renderOptions, state.graphic));
69+
repaint();
70+
});
6871
}
6972

7073
/**

0 commit comments

Comments
 (0)