Changeset 946


Ignore:
Timestamp:
May 9, 2006, 3:57:47 AM (14 years ago)
Author:
Sam Hocevar
Message:
  • If the ANSI file we import does not use the 80 columns, we don't expand the canvas to 80 columns.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/cucul/import.c

    r920 r946  
    244244    cucul_canvas_t *cv;
    245245    unsigned int i, j, skip, dummy = 0;
    246     unsigned int width = 80, height = 25;
     246    unsigned int width = 1, height = 1;
    247247    int x = 0, y = 0, save_x = 0, save_y = 0;
    248248
     
    263263
    264264        /* Wrap long lines */
    265         if((unsigned int)x >= width)
     265        if((unsigned int)x >= 80)
    266266        {
    267267            x = 0;
     
    380380                break;
    381381            case 'K': /* EL - Erase In Line */
    382                 for(j = x; j < width; j++)
     382                if(width < 80)
     383                    cucul_set_canvas_size(cv, width = 80, height);
     384                for(j = x; j < 80; j++)
    383385                    _cucul_putchar32(cv, j, y, (uint32_t)' ');
    384                 x = width;
     386                x = 80;
    385387                break;
    386388            case 'm': /* SGR - Select Graphic Rendition */
     
    397399        /* We're going to paste a character. First make sure the canvas
    398400         * is big enough. */
     401        if((unsigned int)x >= width)
     402            cucul_set_canvas_size(cv, width = x + 1, height);
     403
    399404        if((unsigned int)y >= height)
    400         {
    401             height = y + 1;
    402             cucul_set_canvas_size(cv, width, height);
    403         }
     405            cucul_set_canvas_size(cv, width, height = y + 1);
    404406
    405407        /* Now paste our character */
Note: See TracChangeset for help on using the changeset viewer.