Browse Source

* Small optimisation in import_text().

tags/v0.99.beta14
Sam Hocevar sam 18 years ago
parent
commit
930abfc743
1 changed files with 5 additions and 8 deletions
  1. +5
    -8
      cucul/import.c

+ 5
- 8
cucul/import.c View File

@@ -39,6 +39,8 @@ static cucul_canvas_t *import_ansi(void const *, unsigned int);
*
* \li \c "": attempt to autodetect the file format.
*
* \li \c "ansi": import ANSI files.
*
* \li \c "caca": import native libcaca files.
*
* \param data The memory area to be loaded into a canvas.
@@ -175,15 +177,10 @@ static cucul_canvas_t *import_text(void const *data, unsigned int size)
continue;
}

while(x >= width)
{
width++;
cucul_set_canvas_size(cv, width, height);
}

while(y >= height)
if(x >= width || y >= height)
{
height++;
width = x + 1;
height = y + 1;
cucul_set_canvas_size(cv, width, height);
}



Loading…
Cancel
Save