Ignore:
Timestamp:
Oct 31, 2008, 4:16:53 PM (12 years ago)
Author:
Sam Hocevar
Message:

Quick and dirty implementation of pipi_draw_rectangle() to save zMoo.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/pipi/paint/line.c

    r2904 r3164  
    110110    clip_line(img, &s);
    111111    return 0;
     112}
     113
     114int pipi_draw_rectangle(pipi_image_t *img , int xa, int ya, int xb, int yb, uint32_t c, int aa)
     115{
     116    while(ya < yb)
     117    {
     118        pipi_draw_line(img, xa, ya, xb, ya, c, aa);
     119        ya++;
     120    }
     121
     122    while(ya > yb)
     123    {
     124        pipi_draw_line(img, xa, ya, xb, ya, c, aa);
     125        ya--;
     126    }
     127
     128    return pipi_draw_line(img, xa, yb, xb, yb, c, aa);
    112129}
    113130
Note: See TracChangeset for help on using the changeset viewer.