Ignore:
Timestamp:
Mar 2, 2008, 3:27:43 PM (15 years ago)
Author:
Jean-Yves Lamoureux
Message:
  • Fixed line transitions (both vertical and horizontal ones)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/src/cacademo.c

    r2049 r2254  
    231231    float angle = (0.0075f * completed * 360) * 3.14 / 180, x, y;
    232232    unsigned int i;
     233    int w = cucul_get_canvas_width(mask);
     234    int h = cucul_get_canvas_height(mask);
    233235
    234236    switch(tmode)
     
    294296            for(i = 0; i < 8; i++)
    295297            {
    296                 int w = cucul_get_canvas_width(mask);
    297                 int h = cucul_get_canvas_height(mask);
    298                 int z = ((i & 1) ? h : -h) * (100 - completed) / 100;
    299 
    300                 cucul_fill_box(mask, i * w / 8, z, (i + 1) * w / 8, z + h, '#');
     298                int z = ((i & 1) ? w : (-w)/2) * (100 - completed) / 100;
     299                cucul_fill_box(mask, i * w / 8, z ,  (w / 8) + 1, z + h, '#');
    301300            }
    302301            break;
    303302
    304303        case TRANSITION_HLINES:
     304
    305305            for(i = 0; i < 6; i++)
    306306            {
    307                 int w = cucul_get_canvas_width(mask);
    308                 int h = cucul_get_canvas_height(mask);
    309                 int z = ((i & 1) ? w : -w) * (100 - completed) / 100;
    310 
    311                 cucul_fill_box(mask, z, i * h / 6, z + w, (i + 1) * h / 6, '#');
     307                int z = ((i & 1) ? w : (-w)/2) * (100 - completed) / 100;
     308                cucul_fill_box(mask, z, i * h / 6, z + w, (h / 6) + 1, '#');
    312309            }
    313310            break;
Note: See TracChangeset for help on using the changeset viewer.