@Override
	public void mouseDragged(MouseEvent e) {
		if(px == null && py == null){
			px = e.getX();
			py = e.getY();
		}
		x = e.getX();
		y = e.getY();
		Graphics2D g2 = (Graphics2D) canvas.getImg().getGraphics();
		g2.setColor(canvas.getColor());
		g2.setStroke(canvas.getStroke());
		if (x != -1 && y != -1) {
			g2.drawLine(px, py, x, y);
		}
		canvas.repaint();
		px = x;
		py = y;
	}