Permalink
Browse files

GLK: FROTZ: Fix text display for v6 games

  • Loading branch information...
dreammaster committed Jan 7, 2019
1 parent 9b78664 commit 0793196a52a83970bb9bb4ac36f3068739afa543
Showing with 6 additions and 4 deletions.
  1. +2 −2 engines/glk/window_text_buffer.cpp
  2. +2 −2 engines/glk/window_text_grid.cpp
  3. +2 −0 engines/glk/windows.h
@@ -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;
@@ -57,8 +57,8 @@ void TextGridWindow::rearrange(const Rect &box) {
Window::rearrange(box);
int newwid, newhgt;

newwid = box.width() / _font._cellW;
newhgt = box.height() / _font._cellH;
newwid = MAX(box.width() / _font._cellW, 0);
newhgt = MAX(box.height() / _font._cellH, 0);

if (newwid == _width && newhgt == _height)
return;
@@ -432,13 +432,15 @@ class Window {
virtual void setSize(const Point &newSize) {
_bbox.setWidth(newSize.x);
_bbox.setHeight(newSize.y);
rearrange(_bbox);
}

/**
* Sets the position of a window
*/
virtual void setPosition(const Point &newPos) {
_bbox.moveTo(newPos);
rearrange(_bbox);
}

/**

0 comments on commit 0793196

Please sign in to comment.