Specially in beamer presentations, I use a custom environment to change the vertical space around a formula. The code is:
\newenvironment{shrinkeq}[1]
{ \bgroup
\addtolength\abovedisplayshortskip{#1}
\addtolength\abovedisplayskip{#1}
\addtolength\belowdisplayshortskip{#1}
\addtolength\belowdisplayskip{#1}}
{\egroup}
However, an unwanted horizontal space is added in front of the text following the formula. For example, the code
Text before text before text before\dots
\[ \int_{a_1}^{b_1}f(x)dx+\int_{a_2}^{b_2}g(x)dx+\int_{a_3}^{b_3}h(x)dx=0 \]
Text after text after text after\dots
\bigskip
Text before text before text before\dots
\begin{shrinkeq}{-2ex}
\[ \int_{a_1}^{b_1}f(x)dx+\int_{a_2}^{b_2}g(x)dx+\int_{a_3}^{b_3}h(x)dx=0 \]
\end{shrinkeq}
Text after text after text after\dots
produces

The issue can be fixed by putting a \null after \end{shrinkeq} but I do not understand why this works.
¿Is there a better way to do this?