mUp(e){
        //console.log("mouse up event");
         
        // create the drag and drop rectangle if mouseDown is true
        if (this.mouseDown == true){
            if (Button.Shape == "Rectangle"){
                // rectangle object is created, using the dimesions of the draw guide
                var temp= new Rectangle(this.xMouseStart, this.yMouseStart, this.w, this.h, Swatch.Colour );
                // add new object to object list
                this.ObjectSet.push(temp);
            }else if(Button.Shape == "Ellipse"){
                // ellipse object is created, using the dimesions of the draw guide
                var temp = new Ellipse(this.xMouseStart, this.yMouseStart, this.w, this.h, Swatch.Colour );
                //console.log(temp)
                // add new object to object list
                this.ObjectSet.push(temp); 
            }
            else if(Button.Shape == "Triangle"){
                // triangle object is created, using the dimesions of the draw guide
                var temp = new Triangle(this.xMouseStart, this.yMouseStart, this.w, this.h, Swatch.Colour);
                //console.log(temp)
                // add new object to object list
                this.ObjectSet.push(temp); 
            }
            else if(Button.Shape == "Polygon"){
                // polygon object is created, using the dimesions of the draw guide
                var temp = new Polygon(this.xMouseStart + this.w/2, this.yMouseStart + this.h/2, this.h, this.w, Polygon_buttons.Sides, Swatch.Colour);
                // add new object to object list
                this.ObjectSet.push(temp);  
            }
            
            
            
            
    
        }

        //console.log(temp)
        this.mouseDown = false;
        

    }
// this function is called when the user has released their click
this function is called when the user has released their click
this function is called when the user has released their click
mUp(e){
        if (this.mouseDown == true){
            if (Button.Shape == "Rectangle"){
                var temp= new Rectangle(this.xMouseStart, this.yMouseStart, this.w, this.h, Swatch.Colour );
                this.ObjectSet.push(temp);
            }else if(Button.Shape == "Ellipse"){
                var temp = new Ellipse(this.xMouseStart, this.yMouseStart, this.w, this.h, Swatch.Colour );
                this.ObjectSet.push(temp); 
            }
            else if(Button.Shape == "Triangle"){
                var temp = new Triangle(this.xMouseStart, this.yMouseStart, this.w, this.h, Swatch.Colour);
                this.ObjectSet.push(temp); 
            }
            else if(Button.Shape == "Polygon"){
                var temp = new Polygon(this.xMouseStart + this.w/2, this.yMouseStart + this.h/2, this.h, this.w, Polygon_buttons.Sides, Swatch.Colour);
                this.ObjectSet.push(temp);  
            }
        }
        this.mouseDown = false;
    }
mUp ( e ) { if ( this . mouseDown == true ) { if ( Button . Shape == "Rectangle" ) { var temp = new Rectangle ( this . xMouseStart , this . yMouseStart , this . w , this . h , Swatch . Colour ) ; this . ObjectSet . push ( temp ) ; } else if ( Button . Shape == "Ellipse" ) { var temp = new Ellipse ( this . xMouseStart , this . yMouseStart , this . w , this . h , Swatch . Colour ) ; this . ObjectSet . push ( temp ) ; } else if ( Button . Shape == "Triangle" ) { var temp = new Triangle ( this . xMouseStart , this . yMouseStart , this . w , this . h , Swatch . Colour ) ; this . ObjectSet . push ( temp ) ; } else if ( Button . Shape == "Polygon" ) { var temp = new Polygon ( this . xMouseStart + this . w / 2 , this . yMouseStart + this . h / 2 , this . h , this . w , Polygon_buttons . Sides , Swatch . Colour ) ; this . ObjectSet . push ( temp ) ; } } this . mouseDown = false ; }
this function is called when the user has released their click
this function is called when the user has released their click
//console.log("mouse up event"); // create the drag and drop rectangle if mouseDown is true // rectangle object is created, using the dimesions of the draw guide // add new object to object list // ellipse object is created, using the dimesions of the draw guide //console.log(temp) // add new object to object list // triangle object is created, using the dimesions of the draw guide //console.log(temp) // add new object to object list // polygon object is created, using the dimesions of the draw guide // add new object to object list //console.log(temp)