I'm trying to figure out how to grab a fabric object and change its properties when its moving. I have three different shapes. A fabric.Rect, fabric.Circle and fabric.Triangle. They all have different property values so if anyone knows how to change them accordingly that would be greatly appreciated.
This is how I tried doing it with no success.
canvas.on('object:moving', function(e) {
  var activeObject = e.target;
  activeObject.shadow = null;
   if (e.target = fabric.Rect){
    activeObject.height = 40;
    activeObject.width = 40;
    };
    if (e.target = fabric.Circle){
     activeObject.radius = 20; 
     };
    if (e.target = fabric.Triangle){
     activeObject.height = 40;
     activeObject.width = 35 
     };
});