javascript - Adding an object in a function in fabric.js -


i trying add objects when user clicks on different object. below code not work. tried adding setcoords, did not seem anything. interestingly enough, remove works intended. advice

var showeron = 0; //0 == off 1 == on var sprayoption = 0;  var massageoption = 0; var trickleoption = 0;  function selectshower() {   if(showeron == 1) {     showerbutton.fill = 'yellow';     canvas.add(showerspray);     canvas.add(showermassage);     canvas.add(showertrickle);   }   else {     showerbutton.fill = 'white';     showerspray.fill = 'white';     showermassage.fill = 'white';     showertrickle.fill = 'white';     sprayoption = 0;      massageoption = 0;     trickleoption = 0;     canvas.remove(showerspray);     canvas.remove(showermassage);     canvas.remove(showertrickle);   } }  showerbutton.on('selected', function() {   showeron = 1 - showeron;   selectshower();   canvas.deactivateall(); }); 


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -