[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Double-width char + pad bug
From: |
Kriang Lerdsuwanakij |
Subject: |
Double-width char + pad bug |
Date: |
Sun, 12 May 2002 17:17:28 +0700 |
Hi
I encounter a bug when the pad features is used together
with the new double-width support in recent ncurses
snapshot. When drawing the content of a pad to the
screen, half of a double-width char may fall off the
display area.
One case is when such char. fall off to the left and the
NAC char appears as the first char to be drawn.
Currently, ncurses suppress the NAC display and continue
drawing the remaining chars in the row. The position
of drawn chars are one position left of what it should
be and some garbage char appears at the end. Following
is an illustration of the problem: ([] represents a double
width char, | is the left edge of display area)
<---> drawn char
pad content [|][][]
ideally should be drawn as
|][][]
but is drawn as
|[][]?
^--- garbage char from previous screen
The other case is when char. fall off the right edge of
the screen. That char. should be suppressed otherwise
the next char. is overwritten.
Appended to the mail is a proposed fixed to the first
case. Perhaps some other char could be used in place
of space for the NAC. The second case affects not only
pad but also ordinary window so a lot of code has to
be changed. Other than those problem, the Unicode
support is great. Thanks for the nice work.
--Kriang
*** ncurses-5.2-save/ncurses/base/lib_pad.c Wed May 8 21:38:01 2002
--- ncurses-5.2-new/ncurses/base/lib_pad.c Wed May 8 21:35:38 2002
*************** pnoutrefresh
*** 194,200 ****
register struct ldat *nline = &newscr->_line[m];
register struct ldat *oline = &win->_line[i];
! for (j = pmincol, n = smincol; j <= pmaxcol; j++, n++) {
if (!CharEq(oline->text[j], nline->text[n])) {
nline->text[n] = oline->text[j];
CHANGED_CELL(nline, n);
--- 194,214 ----
register struct ldat *nline = &newscr->_line[m];
register struct ldat *oline = &win->_line[i];
! NCURSES_CH_T ch;
!
! /*
! * Special case for leftmost character of the displayed area.
! * Only half of a double-width character may be visible.
! */
! ch = oline->text[pmincol];
! if (isnac(ch))
! SetChar(ch, L(' '), AttrOf(oline->text[pmincol-1]));
! if (!CharEq(ch, nline->text[smincol])) {
! nline->text[smincol] = ch;
! CHANGED_CELL(nline, smincol);
! }
!
! for (j = pmincol+1, n = smincol+1; j <= pmaxcol; j++, n++) {
if (!CharEq(oline->text[j], nline->text[n])) {
nline->text[n] = oline->text[j];
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Double-width char + pad bug,
Kriang Lerdsuwanakij <=