Back to shtanton's homepage
summaryrefslogtreecommitdiff
path: root/src/all.c
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2025-04-05 18:36:45 +0100
committerCharlie Stanton <charlie@shtanton.xyz>2025-04-05 18:36:45 +0100
commit1c805d096248db7184b7d935f008ab5ae49a714e (patch)
treebe953f7bb2614eacdcd742149eae80d6ac4f6e57 /src/all.c
parent75d3e5ed4616eb381ae299ea731be739c8629258 (diff)
downloadldjam57-1c805d096248db7184b7d935f008ab5ae49a714e.tar
Fix grid not being offset
Diffstat (limited to 'src/all.c')
-rw-r--r--src/all.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/all.c b/src/all.c
index 372690f..028289c 100644
--- a/src/all.c
+++ b/src/all.c
@@ -115,7 +115,7 @@ static DrawList *render(State *state, UI *ui, Arena *a) {
for (int subx = 0; subx < 2; subx++) {
for (int suby = 0; suby < 2; suby++) {
drawList->els[drawList->len++] = (DrawElement) {
- .x = cellWidth * x + subx * cellWidth / 2,
+ .x = cellWidth * x + GRID_OFFSET_X + subx * cellWidth / 2,
.y = cellHeight * y + suby * cellHeight / 2,
.w = cellWidth / 2,
.h = cellHeight / 2,
@@ -128,7 +128,7 @@ static DrawList *render(State *state, UI *ui, Arena *a) {
}
drawList->els[drawList->len++] = (DrawElement) {
- .x = cellWidth * state->goalx,
+ .x = cellWidth * state->goalx + GRID_OFFSET_X,
.y = cellHeight * state->goaly,
.w = cellWidth,
.h = cellHeight,