Browse Source

force a column alignment after each column containing a fullwidth character.

tags/v0.99.beta17
Ben Wiley Sittler bsittler 16 years ago
parent
commit
e434549a4d
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      caca/codec/export.c

+ 6
- 1
caca/codec/export.c View File

@@ -503,6 +503,7 @@ static void *export_html3(caca_canvas_t const *cv, size_t *bytes)
for(y = 0; y < cv->height; y++) for(y = 0; y < cv->height; y++)
{ {
uint32_t *lineattr = cv->attrs + y * cv->width; uint32_t *lineattr = cv->attrs + y * cv->width;
uint32_t *linechar = cv->chars + y * cv->width;


for(x = 1; x < cv->width; x++) for(x = 1; x < cv->width; x++)
if((! (cell_boundary_bitmap if((! (cell_boundary_bitmap
@@ -511,7 +512,9 @@ static void *export_html3(caca_canvas_t const *cv, size_t *bytes)
: :
has_multi_cell_row)) has_multi_cell_row))
&& &&
((caca_attr_to_ansi_bg(lineattr[x - 1])
((linechar[x - 1] == CACA_MAGIC_FULLWIDTH)
||
(caca_attr_to_ansi_bg(lineattr[x - 1])
!= !=
caca_attr_to_ansi_bg(lineattr[x])) caca_attr_to_ansi_bg(lineattr[x]))
|| ||
@@ -569,6 +572,8 @@ static void *export_html3(caca_canvas_t const *cv, size_t *bytes)
|| ||
(cv->height == 1)) (cv->height == 1))
&& &&
(linechar[x + len - 1] != CACA_MAGIC_FULLWIDTH)
&&
(caca_attr_to_ansi_bg(lineattr[x + len]) (caca_attr_to_ansi_bg(lineattr[x + len])
== ==
caca_attr_to_ansi_bg(lineattr[x])) caca_attr_to_ansi_bg(lineattr[x]))


Loading…
Cancel
Save