@Override
	public void mouseDragged(MouseEvent e) {

		if(SwingUtilities.isLeftMouseButton(e)){
			control.setEndPoint(e.getPoint()); 
			this.repaint();  // refreshing canvas 
		}

		else{

			if(temp!=null){
				// i did not check instance of for efficiency purposes 
				if(model.getShape_type().equalsIgnoreCase("square")){
					// bit math for updating positions of shapes 
					int a=Math.abs(mouse_first.x-s_temp.getStarting_point().x);
					int b=Math.abs(mouse_first.y-s_temp.getStarting_point().y);
					int distx=e.getX()-a;
					int disty=e.getY()-b;

					converted_start=new Point(distx,disty);

					a=Math.abs(mouse_first.x-s_temp.getEnding_point().x);
					b=Math.abs(mouse_first.y-s_temp.getEnding_point().y);


					int sx=e.getX()+a;
					int my=e.getY()+b;

					converted_end=new Point(sx,my);

					model.setCurrent_start(new Point(distx,disty));
					model.setCurrent_end(new Point(sx,my));
				}// if 

				else if(model.getShape_type().equalsIgnoreCase("circle")){
					int a=Math.abs(mouse_first.x-c_temp.getStarting_point().x);
					int b=Math.abs(mouse_first.y-c_temp.getStarting_point().y);
					int distx=e.getX()-a;
					int disty=e.getY()-b;

					converted_start=new Point(distx,disty);

					a=Math.abs(mouse_first.x-c_temp.getEnding_point().x);
					b=Math.abs(mouse_first.y-c_temp.getEnding_point().y);


					int sx=e.getX()+a;
					int my=e.getY()+b;

					converted_end=new Point(sx,my);

					model.setCurrent_start(new Point(distx,disty));
					model.setCurrent_end(new Point(sx,my));
					
				}//else if 

				else if(model.getShape_type().equalsIgnoreCase("line")){
					
					int a=Math.abs(mouse_first.x-l_temp.getStarting_point().x);
					int b=Math.abs(mouse_first.y-l_temp.getStarting_point().y);
					int distx=e.getX()-a;
					int disty=e.getY()-b;

					converted_start=new Point(distx,disty);

					a=Math.abs(mouse_first.x-l_temp.getEnding_point().x);
					b=Math.abs(mouse_first.y-l_temp.getEnding_point().y);

					int sx=e.getX()+a;
					int my=e.getY()+b;

					converted_end=new Point(sx,my);
					model.setCurrent_start(new Point(distx,disty));
					model.setCurrent_end(new Point(sx,my));
				}//else if 
				this.repaint();
			}// temp!=null
		}

	}