@Override
	public void mouseDragged(MouseEvent e) {
		Graphics graphics = d.getGraphics();
		if(this.p.getCurrentTool() == -1){
			if(working_layer != -1){
				if(now_resizing){
					p.resizeFigureUsingCorner(working_layer, active_corner, e.getX(), e.getY());
				}else{
					p.moveFiguresOnLayer(this.working_layer, e.getX()-delta_x, e.getY()-delta_y);
				}
			}
		}else{
			try{
				Thread.sleep(15);
				d.paint(d.getGraphics());
				delta_x = e.getX() - oringin_x ;
				delta_y = e.getY() - origin_y ;
				d.paintDrawable(p.buildDrawable(p.getCurrentTool(), oringin_x, origin_y, delta_x, delta_y), graphics);
			}catch(Exception ex){

			}
		}
		dragged = true;
	}