diff options
| author | Charles.Forsyth <devnull@localhost> | 2006-12-22 17:07:39 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2006-12-22 17:07:39 +0000 |
| commit | 37da2899f40661e3e9631e497da8dc59b971cbd0 (patch) | |
| tree | cbc6d4680e347d906f5fa7fca73214418741df72 /libdraw/border.c | |
| parent | 54bc8ff236ac10b3eaa928fd6bcfc0cdb2ba46ae (diff) | |
20060303a
Diffstat (limited to 'libdraw/border.c')
| -rw-r--r-- | libdraw/border.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libdraw/border.c b/libdraw/border.c new file mode 100644 index 00000000..a75be159 --- /dev/null +++ b/libdraw/border.c @@ -0,0 +1,26 @@ +#include "lib9.h" +#include "draw.h" + +void +borderop(Image *im, Rectangle r, int i, Image *color, Point sp, Drawop op) +{ + if(i < 0){ + r = insetrect(r, i); + sp = addpt(sp, Pt(i,i)); + i = -i; + } + drawop(im, Rect(r.min.x, r.min.y, r.max.x, r.min.y+i), + color, nil, sp, op); + drawop(im, Rect(r.min.x, r.max.y-i, r.max.x, r.max.y), + color, nil, Pt(sp.x, sp.y+Dy(r)-i), op); + drawop(im, Rect(r.min.x, r.min.y+i, r.min.x+i, r.max.y-i), + color, nil, Pt(sp.x, sp.y+i), op); + drawop(im, Rect(r.max.x-i, r.min.y+i, r.max.x, r.max.y-i), + color, nil, Pt(sp.x+Dx(r)-i, sp.y+i), op); +} + +void +border(Image *im, Rectangle r, int i, Image *color, Point sp) +{ + borderop(im, r, i, color, sp, SoverD); +} |
