summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjquast <contact@jeffquast.com>2014-06-29 01:06:10 -0700
committerjquast <contact@jeffquast.com>2014-06-29 01:06:10 -0700
commitc74b8c0a179fcf2fda532a5f87d4980b18d14154 (patch)
tree6b9884f7ea0ad04ff2deff74067a32823ac2c18c
parent07a4df55583e5ed720542106fe26afb34556fcaf (diff)
downloadblessings-c74b8c0a179fcf2fda532a5f87d4980b18d14154.tar.gz
revert the center change after some thought
* it is incompatible with str.center() * considering expectations of term.center(term.reverse('x'))
-rw-r--r--README.rst3
-rw-r--r--blessed/sequences.py4
2 files changed, 4 insertions, 3 deletions
diff --git a/README.rst b/README.rst
index f6258ff..f672672 100644
--- a/README.rst
+++ b/README.rst
@@ -670,8 +670,7 @@ Version History
===============
1.9
* workaround: ignore 'tparm() returned NULL', this occurs on win32
- platforms using PDCurses_ without a termcap or termlib.
- * bugfix: term.center('text') should not padd right side with whitespace.
+ platforms using PDCurses_ where tparm() is not implemented.
1.8
* enhancement: export keyboard-read function as public method ``getch()``,
diff --git a/blessed/sequences.py b/blessed/sequences.py
index b7a8a79..a08c926 100644
--- a/blessed/sequences.py
+++ b/blessed/sequences.py
@@ -409,7 +409,9 @@ class Sequence(unicode):
split = max(0.0, float(width) - self.length()) / 2
leftside = fillchar * int((max(0.0, math.floor(split)))
/ float(len(fillchar)))
- return u''.join((leftside, self))
+ rightside = fillchar * int((max(0.0, math.ceil(split)))
+ / float(len(fillchar)))
+ return u''.join((leftside, self, rightside))
def length(self):
"""S.length() -> int