fixed scrolling with centered aligned text

This commit is contained in:
louis 2016-06-25 05:43:48 +02:00
parent 3b2944496a
commit 3572c27dc9
2 changed files with 2 additions and 2 deletions

View File

@ -528,7 +528,6 @@ void cArea::CreatePixmap(cRect drawPort) {
pix = sdOsd->CreatePixmap(layer, viewPort, drawPort); pix = sdOsd->CreatePixmap(layer, viewPort, drawPort);
if (pix) if (pix)
pix->Clear(); pix->Clear();
int pixTransparency = attribs->Transparency(); int pixTransparency = attribs->Transparency();
if (pixTransparency > 0) { if (pixTransparency > 0) {
SetTransparency(pixTransparency, true); SetTransparency(pixTransparency, true);

View File

@ -421,6 +421,7 @@ void cFuncDrawText::Render(cPixmap *p, int x0, int y0, int colWidth, int rowHeig
} else if (horAlign == eAlign::center) { } else if (horAlign == eAlign::center) {
x = x0 + (contWidth - TextWidth(funcText)) / 2; x = x0 + (contWidth - TextWidth(funcText)) / 2;
} }
if (x < 0) x = 0;
int contHeight = rowHeight > 0 ? rowHeight : container.Height(); int contHeight = rowHeight > 0 ? rowHeight : container.Height();
int y = Y() + y0; int y = Y() + y0;
@ -449,7 +450,7 @@ int cFuncDrawText::FuncX(void) {
} else if (horAlign == eAlign::center) { } else if (horAlign == eAlign::center) {
x = (container.Width() - TextWidth(funcText)) / 2; x = (container.Width() - TextWidth(funcText)) / 2;
} }
return x; return (x >= 0) ? x : 0 ;
} }
int cFuncDrawText::FuncY(void) { int cFuncDrawText::FuncY(void) {