From ada70e0ac950e4ae1ed92bd18ef361b22d67a009 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 21 Nov 2018 00:00:18 +0100 Subject: [PATCH] cc_frm_window.cpp: fix possible oversize render with maximum screen settings Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fac08ce188ad9712904dcc206705020108708aab Author: Thilo Graf Date: 2018-11-21 (Wed, 21 Nov 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_window.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 1ae363f42..c60aab34d 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -180,13 +180,14 @@ void CComponentsWindow::initWindowSize() if (width < 0 && width >= -100) //percentage conversion TODO: behavior inside parent width = frameBuffer->getScreenWidth()*abs(width)/100; - if (width == 0 || (unsigned)width > frameBuffer->getScreenWidth()) - width = frameBuffer->getScreenWidth(); + if (width == 0 || (unsigned)width > frameBuffer->getScreenWidth() + 2*OFFSET_INNER_MID) + width = frameBuffer->getScreenWidth() - 2*OFFSET_INNER_MID; + if (height < 0 && height >= -100) //percentage conversion TODO: behavior inside parent height = frameBuffer->getScreenHeight()*abs(height)/100; - if (height == 0 || (unsigned)height > frameBuffer->getScreenHeight()) - height = frameBuffer->getScreenHeight(); + if (height == 0 || (unsigned)height > frameBuffer->getScreenHeight() + 2*OFFSET_INNER_MID) + height = frameBuffer->getScreenHeight() - 2*OFFSET_INNER_MID; } void CComponentsWindow::initWindowPos() @@ -195,9 +196,9 @@ void CComponentsWindow::initWindowPos() return; if (x == 0) - x = frameBuffer->getScreenX(); + x = frameBuffer->getScreenX() + OFFSET_INNER_MID; if (y == 0) - y = frameBuffer->getScreenY(); + y = frameBuffer->getScreenY() + OFFSET_INNER_MID; } void CComponentsWindow::setWindowCaption(neutrino_locale_t locale_text, const cc_title_alignment_t& align_mode)