Changeset 4138 for toilet


Ignore:
Timestamp:
Dec 16, 2009, 8:20:26 PM (10 years ago)
Author:
Sam Hocevar
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • toilet/trunk/src/figlet.c

    r4134 r4138  
    5959static int flush_figlet(context_t *cx)
    6060{
     61    /* We copy cx->cv into cx->torender instead of swapping pointers
     62     * because that would lose the figfont information. */
     63    /* FIXME: use caca_copy_canvas() or whatever when it's implemented. */
    6164    int ret = caca_flush_figlet(cx->cv);
    62     cx->torender = cx->cv;
    63     cx->cv = caca_create_canvas(0, 0);
     65    cx->torender = caca_create_canvas(caca_get_canvas_width(cx->cv),
     66                                      caca_get_canvas_height(cx->cv));
     67    caca_blit(cx->torender, 0, 0, cx->cv, NULL);
     68    caca_set_canvas_size(cx->cv, 0, 0);
    6469    return ret;
    6570}
Note: See TracChangeset for help on using the changeset viewer.