Re: [dev] [PATCH] Fix selecting clearing and BCE

From: <random832_AT_fastmail.us>
Date: Tue, 23 Apr 2013 16:32:12 -0400

On Tue, Apr 23, 2013, at 16:21, Roberto E. Vargas Caballero wrote:
> In drawregion you have:
>
> 3172 bool ena_sel = sel.bx != -1;
> 3173
> 3174 if(sel.alt ^ IS_SET(MODE_ALTSCREEN))
> 3175 ena_sel = 0;
> ...
> 3190 if(ena_sel && *(new.c) && selected(x, y))
> 3191 new.mode ^= ATTR_REVERSE;
>
> in selclear:
>
> 937 sel.bx = -1;
> 938 tsetdirt(sel.b.y, sel.e.y);
>
> in bpress:
>
> 822 if (sel.snap != 0) {
> 823 tsetdirt(sel.b.y, sel.e.y);
> 824 draw();
> 825 }
>
>
>
> It means when you select something you modify the attribute of the
> selected
> region.

That's not true. Only the attribute passed to xdraws() is altered - the
real attribute stored in the character cell is left alone.

Line 3189 new = term.line[y][x]; makes a _copy_ of
the Glyph structure, and line 3191 only modifies the copy, not the
original.
Received on Tue Apr 23 2013 - 22:32:12 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 23 2013 - 22:36:06 CEST