Don’t rebuild the lines on resize when the width has not changed

- because it is an heavy operation, and it is useless, since the lines
  only change when the width changes.
This commit is contained in:
mathieui 2013-01-23 09:29:28 +01:00
parent 6a81c021e1
commit 61f469bc12

View file

@ -946,8 +946,12 @@ class TextWin(Win):
def resize(self, height, width, y, x, room=None): def resize(self, height, width, y, x, room=None):
with g_lock: with g_lock:
if hasattr(self, 'width'):
old_width = self.width
else:
old_width = None
self._resize(height, width, y, x) self._resize(height, width, y, x)
if room: if room and self.width != old_width:
self.rebuild_everything(room) self.rebuild_everything(room)
def rebuild_everything(self, room): def rebuild_everything(self, room):