The MIL was very, very, VERY offensive and over the line.
(Just a disclaimer, I have strong opinions about anyone who thinks that they not only can, but are obligated to, control what goes into another person's body. I consider that to be, like, one of THE WORST personal offenses.)
And, while the OP was well meaning, and might have had good intentions, her comments, which basically say "Hey, maybe this will motivate you that you shouldn't be eating cake" were not aggressive and offensive like the MILS.. but were very uncalled for.
Seriously.. saying it is okay to bully fat people, because maybe it will motivate them to 'not be fat'.
Not the right angle... Just not the right angle.