summaryrefslogtreecommitdiff
path: root/sys/src/cmd/mothra/libpanel/draw.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2012-03-23 14:34:10 +0100
committercinap_lenrek <cinap_lenrek@gmx.de>2012-03-23 14:34:10 +0100
commit140d0e7efff27c8e0522a2c20bd01abf9eb34499 (patch)
treeeb10b8866fc97ecb0d168ff23a7b2d471231503f /sys/src/cmd/mothra/libpanel/draw.c
parent2d5aecc845ace18efd730e0f207c31f9aca60afe (diff)
mothra: clip to intersection of r and b->clipr when drawing panels
Diffstat (limited to 'sys/src/cmd/mothra/libpanel/draw.c')
-rw-r--r--sys/src/cmd/mothra/libpanel/draw.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/src/cmd/mothra/libpanel/draw.c b/sys/src/cmd/mothra/libpanel/draw.c
index 3aa9bb57b..7dbd19fc1 100644
--- a/sys/src/cmd/mothra/libpanel/draw.c
+++ b/sys/src/cmd/mothra/libpanel/draw.c
@@ -152,8 +152,6 @@ void pl_interior(int state, Point *ul, Point *size){
void pl_drawicon(Image *b, Rectangle r, int stick, int flags, Icon *s){
Rectangle save;
Point ul, offs;
- save=b->clipr;
- replclipr(b, b->repl, r);
ul=r.min;
offs=subpt(subpt(r.max, r.min), pl_iconsize(flags, s));
switch(stick){
@@ -167,6 +165,10 @@ void pl_drawicon(Image *b, Rectangle r, int stick, int flags, Icon *s){
case PLACES: ul.x+=offs.x/2; ul.y+=offs.y; break;
case PLACESE: ul.x+=offs.x; ul.y+=offs.y; break;
}
+ save=b->clipr;
+ if(!rectclip(&r, save))
+ return;
+ replclipr(b, b->repl, r);
if(flags&BITMAP) draw(b, Rpt(ul, addpt(ul, pl_iconsize(flags, s))), s, 0, ZP);
else string(b, ul, pl_black, ZP, font, s);
replclipr(b, b->repl, save);