CTextBox: ensure save screen only if dimensions are valid

0 values are critical
This commit is contained in:
2015-04-13 10:37:45 +02:00
committed by svenhoefer
parent cd53fae2c6
commit 87cbb564a3

View File

@@ -579,10 +579,12 @@ void CTextBox::refreshText(void)
if (!m_nPaintBackground && m_SaveScreen) { if (!m_nPaintBackground && m_SaveScreen) {
if (m_bgpixbuf == NULL){ if (m_bgpixbuf == NULL){
//TRACE("[CTextBox] %s save bg %d\r\n", __FUNCTION__, __LINE__); //TRACE("[CTextBox] %s save bg %d\r\n", __FUNCTION__, __LINE__);
if ((dx * dy) >0){
m_bgpixbuf= new fb_pixel_t[dx * dy]; m_bgpixbuf= new fb_pixel_t[dx * dy];
frameBuffer->SaveScreen(ax, ay, dx, dy, m_bgpixbuf); frameBuffer->SaveScreen(ax, ay, dx, dy, m_bgpixbuf);
} }
} }
}
//Paint Text Background //Paint Text Background
bool allow_paint_bg = (m_old_cText != m_cText || has_changed || m_has_scrolled); bool allow_paint_bg = (m_old_cText != m_cText || has_changed || m_has_scrolled);