Reorganizes draw calls, so that components are drawn ontop of the screen.
@@ -48,6 +48,12 @@ public class Screen extends Component {
* The font to draw with.
*/
public void draw(final Graphics2D gc, final Font font) {
+ // Draw the screen onto the canvas:
+ for (int row = 0 ; row < height ; row++) {
+ strings[row].draw(gc, font, row);
+ }
+
+
// Draw components onto the screen:
components.forEach(component -> {
if (component instanceof Screen) {
@@ -56,11 +62,6 @@ public class Screen extends Component {
component.draw(this);
}
});
-
- // Draw the screen onto the canvas:
- for (int row = 0 ; row < height ; row++) {
- strings[row].draw(gc, font, row);
- }
}
/**
