mUp(e){
        // create shapes if mouseDown is true
        if (this.mouseDown == true){
            // --------- Reactangle button outcomes ------------
            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);
            }
            // --------- Ellipse button outcomes ------------
            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); 
            }
            // --------- Triangle button outcomes ------------
            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); 
            }
            // --------- Polygon button outcomes ------------
            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);  
            }
            // --------- Line button outcomes ------------
            else if(Button.Shape == "Line"){
                if (Circle_buttons.Value == "S"){
                    // line object is created, using the dimesions of the draw guide
                    var temp = new Line(this.xMouseStart, this.yMouseStart, this.xMouse, this.yMouse, 4, Swatch.Colour);
                    // add new object to object list
                    this.ObjectSet.push(temp);
                }
                else if (Circle_buttons.Value == "M"){
                    // line object is created, using the dimesions of the draw guide
                    var temp = new Line(this.xMouseStart, this.yMouseStart, this.xMouse, this.yMouse, 8, Swatch.Colour);
                    // add new object to object list
                    this.ObjectSet.push(temp);
                }
                else if (Circle_buttons.Value == "L"){
                    // line object is created, using the dimesions of the draw guide
                    var temp = new Line(this.xMouseStart, this.yMouseStart, this.xMouse, this.yMouse, 12, Swatch.Colour);
                    // add new object to object list
                    this.ObjectSet.push(temp);
                }
                else{
                    // line object is created, using the dimesions of the draw guide
                    var temp = new Line(this.xMouseStart, this.yMouseStart, this.xMouse, this.yMouse, 8, Swatch.Colour);
                    // add new object to object list
                    this.ObjectSet.push(temp);
                }
            }
            // --------- Diamond button outcomes ------------
            else if(Button.Shape == "Diamond"){
                // diamond object is created, using the dimesions of the draw guide
                var temp = new Diamond(this.xMouseStart, this.yMouseStart, this.w, this.h, Swatch.Colour);
                // add new object to object list
                this.ObjectSet.push(temp);  
            }
            // --------- Rotating Ellipse button outcomes ------------
            else if(Button.Shape == "Rotating Ellipse"){
                // diamond object is created, using the dimesions of the draw guide
                var temp = new RotatingEllipse(this.xMouseStart, this.yMouseStart, this.w, this.h, Swatch.Colour);
                // add new object to object list
                this.ObjectSet.push(temp);  
            }
            // --------- Cool Star button outcomes ------------
            else if(Button.Shape == "Cool Star"){
                // diamond object is created, using the dimesions of the draw guide
                var temp = new Star(this.xMouseStart + this.w/2, this.yMouseStart + this.h/2, Math.min(Math.abs(this.w),Math.abs(this.h))/2, 6, Swatch.Colour);
                // add new object to object list
                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
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);  
            }
            else if(Button.Shape == "Line"){
                if (Circle_buttons.Value == "S"){
                    var temp = new Line(this.xMouseStart, this.yMouseStart, this.xMouse, this.yMouse, 4, Swatch.Colour);
                    this.ObjectSet.push(temp);
                }
                else if (Circle_buttons.Value == "M"){
                    var temp = new Line(this.xMouseStart, this.yMouseStart, this.xMouse, this.yMouse, 8, Swatch.Colour);
                    this.ObjectSet.push(temp);
                }
                else if (Circle_buttons.Value == "L"){
                    var temp = new Line(this.xMouseStart, this.yMouseStart, this.xMouse, this.yMouse, 12, Swatch.Colour);
                    this.ObjectSet.push(temp);
                }
                else{
                    var temp = new Line(this.xMouseStart, this.yMouseStart, this.xMouse, this.yMouse, 8, Swatch.Colour);
                    this.ObjectSet.push(temp);
                }
            }
            else if(Button.Shape == "Diamond"){
                var temp = new Diamond(this.xMouseStart, this.yMouseStart, this.w, this.h, Swatch.Colour);
                this.ObjectSet.push(temp);  
            }
            else if(Button.Shape == "Rotating Ellipse"){
                var temp = new RotatingEllipse(this.xMouseStart, this.yMouseStart, this.w, this.h, Swatch.Colour);
                this.ObjectSet.push(temp);  
            }
            else if(Button.Shape == "Cool Star"){
                var temp = new Star(this.xMouseStart + this.w/2, this.yMouseStart + this.h/2, Math.min(Math.abs(this.w),Math.abs(this.h))/2, 6, 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 ) ; } else if ( Button . Shape == "Line" ) { if ( Circle_buttons . Value == "S" ) { var temp = new Line ( this . xMouseStart , this . yMouseStart , this . xMouse , this . yMouse , 4 , Swatch . Colour ) ; this . ObjectSet . push ( temp ) ; } else if ( Circle_buttons . Value == "M" ) { var temp = new Line ( this . xMouseStart , this . yMouseStart , this . xMouse , this . yMouse , 8 , Swatch . Colour ) ; this . ObjectSet . push ( temp ) ; } else if ( Circle_buttons . Value == "L" ) { var temp = new Line ( this . xMouseStart , this . yMouseStart , this . xMouse , this . yMouse , 12 , Swatch . Colour ) ; this . ObjectSet . push ( temp ) ; } else { var temp = new Line ( this . xMouseStart , this . yMouseStart , this . xMouse , this . yMouse , 8 , Swatch . Colour ) ; this . ObjectSet . push ( temp ) ; } } else if ( Button . Shape == "Diamond" ) { var temp = new Diamond ( this . xMouseStart , this . yMouseStart , this . w , this . h , Swatch . Colour ) ; this . ObjectSet . push ( temp ) ; } else if ( Button . Shape == "Rotating Ellipse" ) { var temp = new RotatingEllipse ( this . xMouseStart , this . yMouseStart , this . w , this . h , Swatch . Colour ) ; this . ObjectSet . push ( temp ) ; } else if ( Button . Shape == "Cool Star" ) { var temp = new Star ( this . xMouseStart + this . w / 2 , this . yMouseStart + this . h / 2 , Math . min ( Math . abs ( this . w ) , Math . abs ( this . h ) ) / 2 , 6 , 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
// create shapes if mouseDown is true // --------- Reactangle button outcomes ------------ // rectangle object is created, using the dimesions of the draw guide // add new object to object list // --------- Ellipse button outcomes ------------ // ellipse object is created, using the dimesions of the draw guide //console.log(temp) // add new object to object list // --------- Triangle button outcomes ------------ // triangle object is created, using the dimesions of the draw guide //console.log(temp) // add new object to object list // --------- Polygon button outcomes ------------ // polygon object is created, using the dimesions of the draw guide // add new object to object list // --------- Line button outcomes ------------ // line object is created, using the dimesions of the draw guide // add new object to object list // line object is created, using the dimesions of the draw guide // add new object to object list // line object is created, using the dimesions of the draw guide // add new object to object list // line object is created, using the dimesions of the draw guide // add new object to object list // --------- Diamond button outcomes ------------ // diamond object is created, using the dimesions of the draw guide // add new object to object list // --------- Rotating Ellipse button outcomes ------------ // diamond object is created, using the dimesions of the draw guide // add new object to object list // --------- Cool Star button outcomes ------------ // diamond object is created, using the dimesions of the draw guide // add new object to object list