You've already forked pygconsole
fix console re-init when dimensions are changed
This commit is contained in:
@@ -587,10 +587,7 @@ class Console():
|
|||||||
if value > 0:
|
if value > 0:
|
||||||
self._width = value
|
self._width = value
|
||||||
# Console re-init
|
# Console re-init
|
||||||
self._presentation_stream = deque([None] * self._width * self._height, self._char_memory_size)
|
self._init_console()
|
||||||
self._cursor = 0
|
|
||||||
self._start_window = 0
|
|
||||||
self._end_window = self._width * self._height - 1
|
|
||||||
else: self.log.warning(f"Console width cannot be negative. The previous value is kept: {self._width}")
|
else: self.log.warning(f"Console width cannot be negative. The previous value is kept: {self._width}")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -607,10 +604,7 @@ class Console():
|
|||||||
if value > 0:
|
if value > 0:
|
||||||
self._height = value
|
self._height = value
|
||||||
# Console re-init
|
# Console re-init
|
||||||
self._presentation_stream = deque([None] * self._width * self._height, self._char_memory_size)
|
self._init_console()
|
||||||
self._cursor = 0
|
|
||||||
self._start_window = 0
|
|
||||||
self._end_window = self._width * self._height - 1
|
|
||||||
else: self.log.warning(f"Console height cannot be negative. The previous value is kept: {self._height}")
|
else: self.log.warning(f"Console height cannot be negative. The previous value is kept: {self._height}")
|
||||||
|
|
||||||
#############################################################
|
#############################################################
|
||||||
|
Reference in New Issue
Block a user