From 3572c27dc98e5d7c52ea1513fa2056d323d7d396 Mon Sep 17 00:00:00 2001 From: louis Date: Sat, 25 Jun 2016 05:43:48 +0200 Subject: [PATCH] fixed scrolling with centered aligned text --- coreengine/area.c | 1 - coreengine/functions.c | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/coreengine/area.c b/coreengine/area.c index 6e4beb1..fe96ca2 100644 --- a/coreengine/area.c +++ b/coreengine/area.c @@ -528,7 +528,6 @@ void cArea::CreatePixmap(cRect drawPort) { pix = sdOsd->CreatePixmap(layer, viewPort, drawPort); if (pix) pix->Clear(); - int pixTransparency = attribs->Transparency(); if (pixTransparency > 0) { SetTransparency(pixTransparency, true); diff --git a/coreengine/functions.c b/coreengine/functions.c index 928abf3..35cff67 100644 --- a/coreengine/functions.c +++ b/coreengine/functions.c @@ -421,6 +421,7 @@ void cFuncDrawText::Render(cPixmap *p, int x0, int y0, int colWidth, int rowHeig } else if (horAlign == eAlign::center) { x = x0 + (contWidth - TextWidth(funcText)) / 2; } + if (x < 0) x = 0; int contHeight = rowHeight > 0 ? rowHeight : container.Height(); int y = Y() + y0; @@ -449,7 +450,7 @@ int cFuncDrawText::FuncX(void) { } else if (horAlign == eAlign::center) { x = (container.Width() - TextWidth(funcText)) / 2; } - return x; + return (x >= 0) ? x : 0 ; } int cFuncDrawText::FuncY(void) {