[tor-commits] [arm/master] fix: cropping displayed by an extra cell
atagar at torproject.org
atagar at torproject.org
Sat Jun 18 23:14:48 UTC 2011
commit 7dc62fb0aee20285c0651c97ea42d37b82e255a2
Author: Damian Johnson <atagar at torproject.org>
Date: Fri Jun 17 20:04:55 2011 -0700
fix: cropping displayed by an extra cell
The width panels were using was off by one (probably due to being overly
conservative about curses crashes long, long ago).
---
src/util/panel.py | 2 +-
src/util/uiTools.py | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/util/panel.py b/src/util/panel.py
index 70f72a3..3bdcd6f 100644
--- a/src/util/panel.py
+++ b/src/util/panel.py
@@ -403,7 +403,7 @@ class Panel():
try:
if forceRedraw:
self.win.erase() # clears any old contents
- self.draw(self.maxX - 1, self.maxY)
+ self.draw(self.maxX, self.maxY)
self.win.refresh()
finally:
CURSES_LOCK.release()
diff --git a/src/util/uiTools.py b/src/util/uiTools.py
index 1b32caa..ce467c3 100644
--- a/src/util/uiTools.py
+++ b/src/util/uiTools.py
@@ -315,18 +315,18 @@ def drawBox(panel, top, left, width, height, attr=curses.A_NORMAL):
"""
# draws the top and bottom
- panel.hline(top, left + 1, width - 1, attr)
- panel.hline(top + height - 1, left + 1, width - 1, attr)
+ panel.hline(top, left + 1, width - 2, attr)
+ panel.hline(top + height - 1, left + 1, width - 2, attr)
# draws the left and right sides
panel.vline(top + 1, left, height - 2, attr)
- panel.vline(top + 1, left + width, height - 2, attr)
+ panel.vline(top + 1, left + width - 1, height - 2, attr)
# draws the corners
panel.addch(top, left, curses.ACS_ULCORNER, attr)
- panel.addch(top, left + width, curses.ACS_URCORNER, attr)
+ panel.addch(top, left + width - 1, curses.ACS_URCORNER, attr)
panel.addch(top + height - 1, left, curses.ACS_LLCORNER, attr)
- panel.addch(top + height - 1, left + width, curses.ACS_LRCORNER, attr)
+ panel.addch(top + height - 1, left + width - 1, curses.ACS_LRCORNER, attr)
def isSelectionKey(key):
"""
More information about the tor-commits
mailing list