From a3add1cdcbd30704a34d2876f556d0bff8694402 Mon Sep 17 00:00:00 2001 From: rodri Date: Sat, 7 Sep 2024 17:59:19 +0000 Subject: debug/plmon: swap LMB and RMB. --- debug/plmon.c | 64 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'debug/plmon.c') diff --git a/debug/plmon.c b/debug/plmon.c index 5c60b25..5eeaa30 100644 --- a/debug/plmon.c +++ b/debug/plmon.c @@ -136,18 +136,28 @@ initcolors(void) void lmb(Mousectl *mc) { - Mouse m; + Task *t; + Slot *s; + Rectangle r; + Point2 p; + int dy; - for(;;){ - m = mc->Mouse; - if(readmouse(mc) < 0) - break; - if((mc->buttons & 7) != 1) - break; - graphrf.p.x += mc->xy.x - m.xy.x; - if(graphrf.p.x > Graphoff) - graphrf.p.x = Graphoff; - redraw(); + dy = (Dy(screen->r) - font->height)/sched.ntask; + for(t = sched.tasks; t < sched.tasks+sched.ntask; t++){ + graphrf.p.y = (t - sched.tasks)*dy+dy; + for(s = t->times; s < t->times+t->ntime; s++){ + p = invrframexform(Pt2(s->t0,0,1), graphrf); + r.min = Pt(p.x,p.y-Slotht); + p = invrframexform(Pt2(s->t1,0,1), graphrf); + r.max = Pt(p.x+1,p.y); + if(r.min.x < Graphoff) + r.min.x = Graphoff; + if(ptinrect(subpt(mc->xy, screen->r.min), r)){ + curts = s; + nbsend(drawc, nil); + return; + } + } } } @@ -173,28 +183,18 @@ mmb(Mousectl *mc) void rmb(Mousectl *mc) { - Task *t; - Slot *s; - Rectangle r; - Point2 p; - int dy; + Mouse m; - dy = (Dy(screen->r) - font->height)/sched.ntask; - for(t = sched.tasks; t < sched.tasks+sched.ntask; t++){ - graphrf.p.y = (t - sched.tasks)*dy+dy; - for(s = t->times; s < t->times+t->ntime; s++){ - p = invrframexform(Pt2(s->t0,0,1), graphrf); - r.min = Pt(p.x,p.y-Slotht); - p = invrframexform(Pt2(s->t1,0,1), graphrf); - r.max = Pt(p.x+1,p.y); - if(r.min.x < Graphoff) - r.min.x = Graphoff; - if(ptinrect(subpt(mc->xy, screen->r.min), r)){ - curts = s; - nbsend(drawc, nil); - return; - } - } + for(;;){ + m = mc->Mouse; + if(readmouse(mc) < 0) + break; + if((mc->buttons & 7) != 4) + break; + graphrf.p.x += mc->xy.x - m.xy.x; + if(graphrf.p.x > Graphoff) + graphrf.p.x = Graphoff; + redraw(); } } -- cgit v1.2.3