Browse Source

Canvas fix

krabs 8 năm trước cách đây
mục cha
commit
a368ae1737
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/ui/view/MyCanvas.java

+ 1 - 1
src/ui/view/MyCanvas.java

@@ -37,6 +37,7 @@ class MyCanvas extends JPanel implements MouseListener
     public void paintComponent(Graphics g)
     {
         // Draws the image to the canvas
+    	super.paintComponent(g);
         g.drawImage(img, x, y, null);
     }
 
@@ -69,7 +70,6 @@ class MyCanvas extends JPanel implements MouseListener
         y = e.getY();
 
         Graphics g = img.getGraphics();
-        g.fillOval(x, y, 3, 3);
         System.out.println("Draw!");
 		repaint();
 	}