From 01f0d64f0c3755483c918b88b8b3eeb4bdaf8261 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 11 Jul 2020 02:01:49 +0200 Subject: [PATCH] glcd: center welcome message Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/34981eceda8653f6864aec6b7cbc74b01e4d914a Author: vanhofen Date: 2020-07-11 (Sat, 11 Jul 2020) Origin message was: ------------------ - glcd: center welcome message ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/glcd/glcd.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/driver/glcd/glcd.cpp b/src/driver/glcd/glcd.cpp index 82221729c..811e72841 100644 --- a/src/driver/glcd/glcd.cpp +++ b/src/driver/glcd/glcd.cpp @@ -209,9 +209,10 @@ void cGLCD::Exec() int fw = font_epg.Width(Epg); font_tmp.LoadFT2(t.glcd_font, "UTF-8", fontsize_epg * bitmap->Width() / fw); fw = font_tmp.Width(Epg); + int fh = font_tmp.Height(Epg); drawText(std::max(2,(bitmap->Width() - fw)/2), - 10 * bitmap->Height()/100, bitmap->Width(), fw, Epg, + std::max(2,(bitmap->Height() - fh)/2), bitmap->Width(), fw, Epg, &font_tmp, ColorConvert3to1(t.glcd_color_fg_red, t.glcd_color_fg_green, t.glcd_color_fg_blue), GLCD::cColor::Transparent, true, 0, ALIGN_NONE); lcd->SetScreen(bitmap->Data(), bitmap->Width(), bitmap->Height());