diff options
author | Jeff Sickel <jas@corpus-callosum.com> | 2008-12-03 02:13:38 -0600 |
---|---|---|
committer | Jeff Sickel <jas@corpus-callosum.com> | 2008-12-03 02:13:38 -0600 |
commit | 41305b23558a51c5a6fa33bc7476df1ed6221667 (patch) | |
tree | 4b3c4efb2492c765fe1e35b475e2858439c5f8a8 /src/libdraw | |
parent | f4d56d7218169816fcbc304c7848d48ab78315a4 (diff) | |
download | plan9port-41305b23558a51c5a6fa33bc7476df1ed6221667.tar.gz plan9port-41305b23558a51c5a6fa33bc7476df1ed6221667.tar.bz2 plan9port-41305b23558a51c5a6fa33bc7476df1ed6221667.zip |
libdraw: add borderop
Diffstat (limited to 'src/libdraw')
-rw-r--r-- | src/libdraw/border.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/libdraw/border.c b/src/libdraw/border.c index 22637dfa..52eaa152 100644 --- a/src/libdraw/border.c +++ b/src/libdraw/border.c @@ -3,19 +3,25 @@ #include <draw.h> void -border(Image *im, Rectangle r, int i, Image *color, Point sp) +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; } - draw(im, Rect(r.min.x, r.min.y, r.max.x, r.min.y+i), - color, nil, sp); - draw(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)); - draw(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)); - draw(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)); + 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); } |