From b3719d1331206ca485206f76435709daf5d351cb Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Sun, 10 Aug 2014 04:56:00 +0000 Subject: [PATCH] Correct the viewport area in TextManualDialog Hardcoded coordinates now follow gmenu2x's usual content area rules. Copy-pasted from TextDialog. --- src/textmanualdialog.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/textmanualdialog.cpp b/src/textmanualdialog.cpp index 1b17a6c..5171981 100644 --- a/src/textmanualdialog.cpp +++ b/src/textmanualdialog.cpp @@ -92,7 +92,11 @@ void TextManualDialog::exec() { ss >> spagecount; string pageStatus; - const unsigned rowsPerPage = max(180u / gmenu2x->font->getLineSpacing(), 1u); + const int fontHeight = gmenu2x->font->getLineSpacing(); + unsigned int contentY, contentHeight; + tie(contentY, contentHeight) = gmenu2x->getContentArea(); + const unsigned rowsPerPage = max(contentHeight / fontHeight, 1u); + contentY += (contentHeight % fontHeight) / 2; unsigned page = 0, firstRow = 0; bool close = false; @@ -102,7 +106,7 @@ void TextManualDialog::exec() { bg.blit(s,0,0); writeSubTitle(s, pages[page].title); - drawText(pages[page].text, 42 /* TODO */, firstRow, rowsPerPage); + drawText(pages[page].text, contentY, firstRow, rowsPerPage); ss.clear(); ss << page+1;