summaryrefslogtreecommitdiff
path: root/sys/src/cmd/mothra/libpanel/rtext.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/rtext.c
parent2d5aecc845ace18efd730e0f207c31f9aca60afe (diff)
mothra: clip to intersection of r and b->clipr when drawing panels
Diffstat (limited to 'sys/src/cmd/mothra/libpanel/rtext.c')
-rw-r--r--sys/src/cmd/mothra/libpanel/rtext.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/src/cmd/mothra/libpanel/rtext.c b/sys/src/cmd/mothra/libpanel/rtext.c
index 0f03c5212..4a33e406f 100644
--- a/sys/src/cmd/mothra/libpanel/rtext.c
+++ b/sys/src/cmd/mothra/libpanel/rtext.c
@@ -153,8 +153,13 @@ void pl_rtdraw(Image *b, Rectangle r, Rtext *t, int yoffs){
Point offs;
Rectangle dr;
Rectangle cr;
+ Rectangle xr;
+
+ xr=r;
cr=b->clipr;
- replclipr(b, b->repl, r);
+ if(!rectclip(&xr, cr))
+ return;
+ replclipr(b, b->repl, xr);
pl_clr(b, r);
offs=subpt(r.min, Pt(0, yoffs));
for(;t;t=t->next) if(!eqrect(t->r, Rect(0,0,0,0))){
@@ -162,7 +167,6 @@ void pl_rtdraw(Image *b, Rectangle r, Rtext *t, int yoffs){
if(dr.max.y>r.min.y
&& dr.min.y<r.max.y){
if(t->b){
-// bitblt(b, dr.min, t->b, t->b->r, S|D);
draw(b, Rpt(dr.min, addpt(dr.min, subpt(t->b->r.max, t->b->r.min))), t->b, 0, t->b->r.min);
if(t->hot) border(b, insetrect(dr, -2), 1, display->black, ZP);
}