shithub: puzzles

Download patch

ref: 38dd338652912f056fa5634cd927e5a3f60e0df3
parent: 2a0e91bc76738e36e89abd4dcae5f13bc063d210
author: Robert Konigsberg <konigsberg@gmail.com>
date: Sun May 10 10:30:43 EDT 2020

Provide visual guide to the cursor location across the rows and columns.

--- a/pattern.c
+++ b/pattern.c
@@ -20,6 +20,7 @@
     COL_GRID,
     COL_CURSOR,
     COL_ERROR,
+    COL_CURSOR_GUIDE,
     NCOLOURS
 };
 
@@ -1658,11 +1659,12 @@
     frontend_default_colour(fe, &ret[COL_BACKGROUND * 3]);
 
     for (i = 0; i < 3; i++) {
-        ret[COL_GRID    * 3 + i] = 0.3F;
-        ret[COL_UNKNOWN * 3 + i] = 0.5F;
-        ret[COL_TEXT    * 3 + i] = 0.0F;
-        ret[COL_FULL    * 3 + i] = 0.0F;
-        ret[COL_EMPTY   * 3 + i] = 1.0F;
+        ret[COL_GRID         * 3 + i] = 0.3F;
+        ret[COL_UNKNOWN      * 3 + i] = 0.5F;
+        ret[COL_TEXT         * 3 + i] = 0.0F;
+        ret[COL_FULL         * 3 + i] = 0.0F;
+        ret[COL_EMPTY        * 3 + i] = 1.0F;
+        ret[COL_CURSOR_GUIDE * 3 + i] = 0.5F;
     }
     ret[COL_CURSOR * 3 + 0] = 1.0F;
     ret[COL_CURSOR * 3 + 1] = 0.25F;
@@ -1889,6 +1891,9 @@
      */
     for (i = 0; i < state->common->w + state->common->h; i++) {
         int colour = check_errors(state, i) ? COL_ERROR : COL_TEXT;
+        if (colour == COL_TEXT && ((cx >= 0 && i == cx) || (cy >= 0 && i == cy + ds->w))) {
+            colour = COL_CURSOR_GUIDE;
+        }
         if (ds->numcolours[i] != colour) {
             draw_numbers(dr, ds, state, i, true, colour);
             ds->numcolours[i] = colour;