commit 397fcee40b118e3a9c261a8902ee539702cdc29c
parent b571e30d2d46a63f090106babe63f26a54e90f47
Author: Kyle Milz <krwmilz@gmail.com>
Date: Sat, 11 Mar 2023 18:01:57 +0000
cleanup line_btw()
- ansi function signature
- early return
Diffstat:
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/special.c b/special.c
@@ -101,18 +101,20 @@ static Boolean blacken = False;
* Right now, we ignore pen_size.
*/
static void
-line_btw(fx, fy, tx, ty)
-int fx, fy, tx, ty;
+line_btw(int fx, int fy, int tx, int ty)
{
int fcx = xconv(fx);
int tcx = xconv(tx);
int fcy = yconv(fy);
int tcy = yconv(ty);
- if ((fcx < max_x || tcx < max_x) && (fcx >= min_x || tcx >= min_x) &&
- (fcy < max_y || tcy < max_y) && (fcy >= min_y || tcy >= min_y)) {
- if (fg_active != fg_current) do_color_change();
- XDrawLine(DISP, currwin.win, ruleGC,
+ if ((fcx >= max_x && tcx >= max_x) || (fcx < min_x && tcx < min_x) ||
+ (fcy >= max_y && tcy >= max_y) || (fcy < min_y && tcy < min_y))
+ return;
+ if (fg_active != fg_current)
+ do_color_change();
+
+ XDrawLine(DISP, currwin.win, ruleGC,
fcx - currwin.base_x, fcy - currwin.base_y,
tcx - currwin.base_x, tcy - currwin.base_y);
}