ref: 96626d9c10bd37d060f9cf843b717350c222a344
parent: e2b35b2fc4a2758b09cd2d556d5c058486e91573
author: Simon Tatham <anakin@pobox.com>
date: Wed Oct 9 16:44:50 EDT 2013
Faintly highlight the leading diagonal of Group's grid. This makes it easier to spot elements whose square is known, which is useful in turn for identifying subgroups. [originally from svn r10050]
--- a/unfinished/group.c
+++ b/unfinished/group.c
@@ -62,6 +62,7 @@
COL_HIGHLIGHT,
COL_ERROR,
COL_PENCIL,
+ COL_DIAGONAL,
NCOLOURS
};
@@ -1495,6 +1496,10 @@
ret[COL_PENCIL * 3 + 1] = 0.5F * ret[COL_BACKGROUND * 3 + 1];
ret[COL_PENCIL * 3 + 2] = ret[COL_BACKGROUND * 3 + 2];
+ ret[COL_DIAGONAL * 3 + 0] = 0.95F * ret[COL_BACKGROUND * 3 + 0];
+ ret[COL_DIAGONAL * 3 + 1] = 0.95F * ret[COL_BACKGROUND * 3 + 1];
+ ret[COL_DIAGONAL * 3 + 2] = 0.95F * ret[COL_BACKGROUND * 3 + 2];
+
*ncolours = NCOLOURS;
return ret;
}
@@ -1561,7 +1566,8 @@
/* background needs erasing */
draw_rect(dr, cx, cy, cw, ch,
- (tile & DF_HIGHLIGHT) ? COL_HIGHLIGHT : COL_BACKGROUND);
+ (tile & DF_HIGHLIGHT) ? COL_HIGHLIGHT :
+ (x == y) ? COL_DIAGONAL : COL_BACKGROUND);
/* dividers */
if (tile & DF_DIVIDER_TOP)