It does not break the fast no matter how bad it is. Fast breaks only in commuting any of the nine Mufattiraat ( fasting invalidating acts)e.g. Eating, drinking, smoking, lying on Allah or on The Infallible etc.
Many sinful acts do not invalidate fast despite the fact that they are sinful.
Wassalam.