Using a loop to determine the number of symbols we need is intuitive but
hardly efficient. A Math.ceil in this situation is much better.
After that ceil or the loop that it replaced, the total height should be
equal to the minimal height plus an integral number times the height of the
repeat symbol. That integer equals (half) number of loop iterations in the
original code, and the repeatCount variable in my new code. So later on,
the quotient (repeatHeight / repeatHeightTotal) should be an integer, at
least up to numeric errors. Applying ceil instead of round to that is
asking for these numeric errors to seriously break stuff. Just reusing the
repeatCount is much simpler, shorter and more elegant.
Having distinct topSymbolCount and bottomSymbolCount seems pointless, since
the only reason why these could ever be different is due to the fact that
bottomRepeatHeight was computed using topHeightTotal, which looks like a
bug. The old loop and new ceil assume a symmetric repeatCount.