bdreager / PyClock

A digital clock for the terminal
MIT License
5 stars 3 forks source link

Fix issues in center display #6

Closed livibetter closed 8 years ago

livibetter commented 8 years ago

There are four things:

  1. Removed the blank lines above and below: (self.height*2).
  2. The _width and _height calculations can be done directly, no need of recursions.
  3. Don't add a space width for the last character, or it will look off-center.
  4. output_width and output_height are cached for centering.