瀏覽代碼

Fix a crash with multiline input caused by losing the figfont information.

pull/1/head
Sam Hocevar sam 15 年之前
父節點
當前提交
614e317810
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. +7
    -2
      src/figlet.c

+ 7
- 2
src/figlet.c 查看文件

@@ -58,9 +58,14 @@ static int feed_figlet(context_t *cx, uint32_t ch, uint32_t attr)

static int flush_figlet(context_t *cx)
{
/* We copy cx->cv into cx->torender instead of swapping pointers
* because that would lose the figfont information. */
/* FIXME: use caca_copy_canvas() or whatever when it's implemented. */
int ret = caca_flush_figlet(cx->cv);
cx->torender = cx->cv;
cx->cv = caca_create_canvas(0, 0);
cx->torender = caca_create_canvas(caca_get_canvas_width(cx->cv),
caca_get_canvas_height(cx->cv));
caca_blit(cx->torender, 0, 0, cx->cv, NULL);
caca_set_canvas_size(cx->cv, 0, 0);
return ret;
}



Loading…
取消
儲存