Commit 9c55231
fix(map): anchor the grid at the world's north-west corner, lattice over the whole image
The previous fix kept the partial edge cell but anchored rows at the SOUTH
edge, leaving the remainder as a squished sliver row at the top — rows sat
visibly displaced versus RustMaps and the companion app (columns were fine
because they were already west-anchored).
Rust, the app and RustMaps anchor the grid at the world's NW corner: rows
step south from the top and the partial cell sits at the south/east, bleeding
past the world edge so every visible cell looks full-size. They also draw the
grid lattice across the WHOLE map image (ocean margin included), not clipped
to the world square.
- MapRenderer.DrawGrid: lattice anchored at the NW world corner, lines
spanning the full image in all directions; labels (A0..) only for the
world's ceil-count cells, top-left corner placement unchanged.
- MapGrid.LabelFor: rows bin from the north edge (floor((worldSize - y) /
CellSize)) so grid references match the visible grid; columns unchanged.
- Regression tests lock the north anchoring (1500 world: y=1360 → A0,
y=10 → partial row A10).
Verified against RustMaps 1500/1234 (tmp/images/image.png) and the
companion-app geometry with an ocean-margin base tile.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 0326ff7 commit 9c55231
3 files changed
Lines changed: 52 additions & 27 deletions
File tree
- src
- RustPlusBot.Abstractions/Connections
- RustPlusBot.Features.Map/Rendering
- tests/RustPlusBot.Abstractions.Tests/Connections
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | | - | |
58 | | - | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
119 | 129 | | |
120 | 130 | | |
121 | 131 | | |
122 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
123 | 139 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 140 | + | |
| 141 | + | |
132 | 142 | | |
133 | 143 | | |
| 144 | + | |
| 145 | + | |
134 | 146 | | |
135 | 147 | | |
136 | 148 | | |
137 | 149 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | 150 | | |
144 | 151 | | |
145 | 152 | | |
146 | | - | |
| 153 | + | |
147 | 154 | | |
148 | 155 | | |
149 | 156 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
38 | 54 | | |
39 | 55 | | |
40 | 56 | | |
| |||
0 commit comments