Changeset 3450 for libcaca/trunk


Ignore:
Timestamp:
May 14, 2009, 2:18:37 AM (11 years ago)
Author:
Sam Hocevar
Message:

Fix a few dirty rectangle bugs found with the unit tests. Let that be a
lesson to you: unit tests are good.

Location:
libcaca/trunk/caca
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/attr.c

    r3448 r3450  
    157157    }
    158158
    159     caca_add_dirty_rectangle(cv, xmin, xmax, y, y);
     159    caca_add_dirty_rectangle(cv, xmin, y, xmax, y);
    160160
    161161    return 0;
  • libcaca/trunk/caca/canvas.c

    r3448 r3450  
    322322 *  \param xmin A pointer to an integer where the leftmost edge of the
    323323 *              dirty rectangle will be stored.
     324 *  \param ymin A pointer to an integer where the topmost edge of the
     325 *              dirty rectangle will be stored.
    324326 *  \param xmax A pointer to an integer where the rightmost edge of the
    325  *              dirty rectangle will be stored.
    326  *  \param ymin A pointer to an integer where the topmost edge of the
    327327 *              dirty rectangle will be stored.
    328328 *  \param ymax A pointer to an integer where the bottommost edge of the
     
    330330 *  \return This function always returns 0.
    331331 */
    332 int caca_get_dirty_rectangle(caca_canvas_t *cv, int *xmin, int *xmax,
    333                              int *ymin, int *ymax)
     332int caca_get_dirty_rectangle(caca_canvas_t *cv, int *xmin, int *ymin,
     333                             int *xmax, int *ymax)
    334334{
    335335    *xmin = cv->dirty_xmin;
     
    357357 *  \param cv A libcaca canvas.
    358358 *  \param xmin The leftmost edge of the additional dirty rectangle.
     359 *  \param ymin The topmost edge of the additional dirty rectangle.
    359360 *  \param xmax The rightmost edge of the additional dirty rectangle.
    360  *  \param ymin The topmost edge of the additional dirty rectangle.
    361361 *  \param ymax The bottommost edge of the additional dirty rectangle.
    362362 *  \return This function always returns 0.
    363363 */
    364 int caca_add_dirty_rectangle(caca_canvas_t *cv, int xmin, int xmax,
    365                              int ymin, int ymax)
     364int caca_add_dirty_rectangle(caca_canvas_t *cv, int xmin, int ymin,
     365                             int xmax, int ymax)
    366366{
    367367    /* Ignore empty rectangles. */
     
    400400 *  \param cv A libcaca canvas.
    401401 *  \param xmin The leftmost edge of the desired dirty rectangle.
     402 *  \param ymin The topmost edge of the desired dirty rectangle.
    402403 *  \param xmax The rightmost edge of the desired dirty rectangle.
    403  *  \param ymin The topmost edge of the desired dirty rectangle.
    404404 *  \param ymax The bottommost edge of the desired dirty rectangle.
    405405 *  \return This function always returns 0.
    406406 */
    407 int caca_set_dirty_rectangle(caca_canvas_t *cv, int xmin, int xmax,
    408                              int ymin, int ymax)
     407int caca_set_dirty_rectangle(caca_canvas_t *cv, int xmin, int ymin,
     408                             int xmax, int ymax)
    409409{
    410410    /* Normalise values indicating an empty or out-of-bounds rectangle. */
  • libcaca/trunk/caca/string.c

    r3448 r3450  
    171171         * replace its right part with a space. */
    172172        if(x + 1 != (int)cv->width && curchar[1] == CACA_MAGIC_FULLWIDTH)
     173        {
    173174            curchar[1] = ' ';
    174     }
    175 
    176     caca_add_dirty_rectangle(cv, xmin, xmax, y, y);
     175            xmax++;
     176        }
     177    }
     178
     179    caca_add_dirty_rectangle(cv, xmin, y, xmax, y);
    177180
    178181    curchar[0] = ch;
Note: See TracChangeset for help on using the changeset viewer.