aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/window_text_buffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/glk/window_text_buffer.cpp')
-rw-r--r--engines/glk/window_text_buffer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/glk/window_text_buffer.cpp b/engines/glk/window_text_buffer.cpp
index c33dbae10c..ce4dd7c22e 100644
--- a/engines/glk/window_text_buffer.cpp
+++ b/engines/glk/window_text_buffer.cpp
@@ -75,8 +75,8 @@ void TextBufferWindow::rearrange(const Rect &box) {
int newwid, newhgt;
int rnd;
- newwid = (box.width() - g_conf->_tMarginX * 2 - g_conf->_scrollWidth) / _font._cellW;
- newhgt = (box.height() - g_conf->_tMarginY * 2) / _font._cellH;
+ newwid = MAX((box.width() - g_conf->_tMarginX * 2 - g_conf->_scrollWidth) / _font._cellW, 0);
+ newhgt = MAX((box.height() - g_conf->_tMarginY * 2) / _font._cellH, 0);
// align text with bottom
rnd = newhgt * _font._cellH + g_conf->_tMarginY * 2;