From 8d6909608d3faff88a43408b01097a070c45db21 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 2 Jan 2019 19:17:08 -0800 Subject: GLK: FROTZ: Window positions & sizes are in characters, not pixels --- engines/glk/frotz/windows.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'engines/glk') diff --git a/engines/glk/frotz/windows.cpp b/engines/glk/frotz/windows.cpp index ffee6392c7..e4179caeea 100644 --- a/engines/glk/frotz/windows.cpp +++ b/engines/glk/frotz/windows.cpp @@ -23,6 +23,7 @@ #include "glk/frotz/windows.h" #include "glk/frotz/frotz.h" #include "glk/window_pair.h" +#include "glk/conf.h" namespace Glk { namespace Frotz { @@ -63,7 +64,8 @@ void Window::setSize(const Point &newSize) { winid_t win = getWindow(); checkRepositionLower(); - win->setSize(newSize); + Point s(newSize.x * g_conf->_monoInfo._cellW, newSize.y * g_conf->_monoInfo._cellH); + win->setSize(s); /* TODO // Keep the cursor within the window @@ -78,7 +80,8 @@ void Window::setPosition(const Point &newPos) { winid_t win = getWindow(); checkRepositionLower(); - win->setPosition(newPos); + Point pos((newPos.x - 1) * g_conf->_monoInfo._cellW, (newPos.y - 1) * g_conf->_monoInfo._cellH); + win->setPosition(pos); } const uint16 &Window::operator[](WindowProperty propType) { -- cgit v1.2.3