From ae6f52a0a3ac4c0fe68a7703f942ea790fafc32e Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Thu, 16 Jan 2014 01:16:27 +0100 Subject: [PATCH] Fix BrowseDialog and InputDialog rendering incorrectly Parts of the background were still visible when the upper and lower bars were transparent. --- src/browsedialog.cpp | 12 +++++++----- src/inputdialog.cpp | 14 ++++++++------ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/browsedialog.cpp b/src/browsedialog.cpp index 3205f5b..fa421b9 100644 --- a/src/browsedialog.cpp +++ b/src/browsedialog.cpp @@ -227,12 +227,14 @@ void BrowseDialog::paint() unsigned int firstElement, lastElement; unsigned int offsetY; - gmenu2x->bg->blit(gmenu2x->s, 0, 0); - drawTitleIcon("icons/explorer.png", true); - writeTitle(title); - writeSubTitle(subtitle); + Surface bg(gmenu2x->bg); + drawTitleIcon("icons/explorer.png", true, &bg); + writeTitle(title, &bg); + writeSubTitle(subtitle, &bg); + buttonBox.paint(&bg, 5); - buttonBox.paint(gmenu2x->s, 5); + bg.convertToDisplayFormat(); + bg.blit(gmenu2x->s,0,0); // TODO(MtH): I have no idea what the right value of firstElement would be, // but originally it was undefined and that is never a good idea. diff --git a/src/inputdialog.cpp b/src/inputdialog.cpp index 2ad9225..bc0776e 100644 --- a/src/inputdialog.cpp +++ b/src/inputdialog.cpp @@ -151,15 +151,17 @@ bool InputDialog::exec() { Uint32 caretTick = 0, curTick; bool caretOn = true; + Surface bg(gmenu2x->bg); + drawTitleIcon(icon, false, &bg); + writeTitle(title, &bg); + writeSubTitle(text, &bg); + buttonbox->paint(&bg, 5); + bg.convertToDisplayFormat(); + close = false; ok = true; while (!close) { - gmenu2x->bg->blit(gmenu2x->s,0,0); - writeTitle(title); - writeSubTitle(text); - drawTitleIcon(icon); - - buttonbox->paint(gmenu2x->s, 5); + bg.blit(gmenu2x->s,0,0); box.w = gmenu2x->font->getTextWidth(input) + 18; box.x = 160 - box.w / 2;