commit e67b2c90d777a6c4eb6e4c3b98adc46af517ee10
parent 51abda3fd61d69eaff0d1cc2ed000c4718a20310
Author: Kyle Milz <krwmilz@gmail.com>
Date: Sat, 11 Mar 2023 18:05:44 +0000
cleanup dot_at()
- ansi function signatures
- early return
Diffstat:
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/special.c b/special.c
@@ -123,17 +123,18 @@ line_btw(int fx, int fy, int tx, int ty)
* Draw a dot at (x,y)
*/
static void
-dot_at(x, y)
- int x, y;
+dot_at(int x, int y)
{
int cx = xconv(x);
int cy = yconv(y);
- if (cx < max_x && cx >= min_x && cy < max_y && cy >= min_y) {
- if (fg_active != fg_current) do_color_change();
- XDrawPoint(DISP, currwin.win, ruleGC,
- cx - currwin.base_x, cy - currwin.base_y);
- }
+ if (cx >= max_x || cx < min_x || cy >= max_y || cy < min_y)
+ return;
+ if (fg_active != fg_current)
+ do_color_change();
+
+ XDrawPoint(DISP, currwin.win, ruleGC,
+ cx - currwin.base_x, cy - currwin.base_y);
}
/*