draw_numbers() was considerably confused between the width of the clue
border at the left and the height of the clue border at the top.
Unconfuse it (I think).
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9737
cda61777-01e9-0310-a592-
d414129be87e
if (erase) {
if (i < state->w) {
draw_rect(dr, TOCOORD(state->w, i), 0,
if (erase) {
if (i < state->w) {
draw_rect(dr, TOCOORD(state->w, i), 0,
- TILE_SIZE, BORDER + TLBORDER(state->w) * TILE_SIZE,
+ TILE_SIZE, BORDER + TLBORDER(state->h) * TILE_SIZE,
COL_BACKGROUND);
} else {
draw_rect(dr, 0, TOCOORD(state->h, i - state->w),
COL_BACKGROUND);
} else {
draw_rect(dr, 0, TOCOORD(state->h, i - state->w),
- BORDER + TLBORDER(state->h) * TILE_SIZE, TILE_SIZE,
+ BORDER + TLBORDER(state->w) * TILE_SIZE, TILE_SIZE,
* tile size. However, if there are more numbers than available
* spaces, I have to squash them up a bit.
*/
* tile size. However, if there are more numbers than available
* spaces, I have to squash them up a bit.
*/
- nfit = max(rowlen, TLBORDER(state->h))-1;
+ if (i < state->w)
+ nfit = TLBORDER(state->h);
+ else
+ nfit = TLBORDER(state->w);
+ nfit = max(rowlen, nfit) - 1;
assert(nfit > 0);
for (j = 0; j < rowlen; j++) {
assert(nfit > 0);
for (j = 0; j < rowlen; j++) {
} else {
y = TOCOORD(state->h, i - state->w);
x = BORDER + TILE_SIZE * (TLBORDER(state->w)-1);
} else {
y = TOCOORD(state->h, i - state->w);
x = BORDER + TILE_SIZE * (TLBORDER(state->w)-1);
- x -= ((rowlen-j-1)*TILE_SIZE) * (TLBORDER(state->h)-1) / nfit;
+ x -= ((rowlen-j-1)*TILE_SIZE) * (TLBORDER(state->w)-1) / nfit;
}
sprintf(str, "%d", rowdata[j]);
}
sprintf(str, "%d", rowdata[j]);
if (i < state->w) {
draw_update(dr, TOCOORD(state->w, i), 0,
if (i < state->w) {
draw_update(dr, TOCOORD(state->w, i), 0,
- TILE_SIZE, BORDER + TLBORDER(state->w) * TILE_SIZE);
+ TILE_SIZE, BORDER + TLBORDER(state->h) * TILE_SIZE);
} else {
draw_update(dr, 0, TOCOORD(state->h, i - state->w),
} else {
draw_update(dr, 0, TOCOORD(state->h, i - state->w),
- BORDER + TLBORDER(state->h) * TILE_SIZE, TILE_SIZE);
+ BORDER + TLBORDER(state->w) * TILE_SIZE, TILE_SIZE);