Skip to content

Commit

Permalink
Fixed size detection
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteHamster committed Aug 21, 2019
1 parent 9909e3e commit 4a5d0a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/com/bytehamster/drawingpad/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,6 @@ private JCanvas createCanvas() {
int height = 1000;
BufferedImage inputImage = null;

canvas = new JCanvas(width, height);
graphicsContext = canvas.getGraphics();

if (inputFile != null) {
try {
inputImage = ImageIO.read(inputFile);
Expand All @@ -185,6 +182,9 @@ private JCanvas createCanvas() {
}
}

canvas = new JCanvas(width, height);
graphicsContext = canvas.getGraphics();

graphicsContext.setColor(Color.WHITE);
graphicsContext.fillRect(0, 0, width, height);
graphicsContext.setColor(Color.BLACK);
Expand Down

0 comments on commit 4a5d0a2

Please sign in to comment.