Why does auto format remove my parentheses

took me like 20 minutes to get why my code is not functionning…
this line:
tempRef.x=(limitL-dist-tempRef.width/2)+(tempRef.width+dist)*(i+1);

after auto format becomes like this:
tempRef.x=limitL-dist-tempRef.width/2+tempRef.width+dist*i+1;

that’s not the same thing at all…may I know why this is happening?