From 4b67bdd162425f68b0c0c5c653707f25681b9b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Czerpak?= Date: Mon, 13 Oct 2014 18:53:49 +0200 Subject: [PATCH] 2014-10-13 18:53 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/rtl/gtxwc/gtxwc.c ! fixed recent modification (force character redrawing) --- ChangeLog.txt | 5 +++++ src/rtl/gtxwc/gtxwc.c | 28 ++++++++++++++++++++++++---- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 698c50ce58..08db297e80 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,11 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2014-10-13 18:53 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * src/rtl/gtxwc/gtxwc.c + ! fixed recent modification (force character redrawing) + + 2014-10-13 17:11 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/Makefile ! fixed to only include compilable GTs in Harbour dynlib diff --git a/src/rtl/gtxwc/gtxwc.c b/src/rtl/gtxwc/gtxwc.c index 8f42b4fc49..2b7ef460b1 100644 --- a/src/rtl/gtxwc/gtxwc.c +++ b/src/rtl/gtxwc/gtxwc.c @@ -3654,11 +3654,11 @@ static HB_U32 hb_gt_xwc_HashCurrChar( HB_BYTE attr, HB_BYTE color, HB_USHORT chr static void hb_gt_xwc_RepaintChar( PXWND_DEF wnd, int colStart, int rowStart, int colStop, int rowStop ) { - HB_USHORT irow, icol, scridx, startCol = 0, len, basex, basey, nsize; + HB_USHORT irow, icol, startCol = 0, len, basex, basey, nsize; HB_BYTE oldColor = 0, color, attr; HB_USHORT usCh16, usChBuf[ XWC_MAX_COLS ]; HB_U32 u32Curr = 0xFFFFFFFF; - int i, iColor; + int i, iColor, scridx; XWC_CharTrans * chTrans; #ifdef XWC_DEBUG @@ -3677,7 +3677,7 @@ static void hb_gt_xwc_RepaintChar( PXWND_DEF wnd, int colStart, int rowStart, in for( irow = rowStart; irow <= rowStop; irow++ ) { icol = colStart; - scridx = icol + irow * wnd->cols; + scridx = icol + irow * wnd->cols; len = 0; /* attribute may change mid line... * so buffer up text with same attrib, and output it @@ -3889,6 +3889,21 @@ static void hb_gt_xwc_InvalidateChar( PXWND_DEF wnd, wnd->fInvalidChr = HB_TRUE; } +static void hb_gt_xwc_InvalidateFull( PXWND_DEF wnd, + int left, int top, int right, int bottom ) +{ + int row, col, scridx; + + for( row = top; row <= bottom; row++ ) + { + scridx = row * wnd->cols + left; + for( col = left; col < right; col++, scridx++ ) + wnd->pCurrScr[ scridx ] = 0xFFFFFFFF; + } + + hb_gt_xwc_InvalidateChar( wnd, left, top, right, bottom ); +} + /* *********************************************************************** */ static void hb_gt_xwc_InvalidatePts( PXWND_DEF wnd, @@ -5668,8 +5683,13 @@ static HB_BOOL hb_gt_xwc_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) XPutImage( wnd->dpy, wnd->pm, wnd->gc, xImage, 0, 0, rx.left, rx.top, rx.right - rx.left + 1, rx.bottom - rx.top + 1 ); HB_XWC_XLIB_UNLOCK(); + hb_gt_xwc_InvalidatePts( wnd, rx.left, rx.top, rx.right, rx.bottom ); } - hb_gt_xwc_InvalidatePts( wnd, rx.left, rx.top, rx.right, rx.bottom ); + else + hb_gt_xwc_InvalidateFull( wnd, rx.left / wnd->fontWidth, + rx.top / wnd->fontHeight, + ( rx.right + wnd->fontWidth - 1 ) / wnd->fontWidth, + ( rx.bottom + wnd->fontHeight - 1 ) / wnd->fontHeight ); if( HB_GTSELF_DISPCOUNT( pGT ) == 0 ) hb_gt_xwc_RealRefresh( wnd, HB_FALSE ); }