Retire the 'middle_face' field in 'struct grid', together with the

overly complicated algorithm that uses it to home in on the grid edge
closest to a mouse click. That algorithm is being stressed beyond its
limit by the new grid type, and it's unnecessary anyway given that no
sensibly sized puzzle grid is going to be big enough to make it
prohibitively expensive just to do the trivial approach of iterating
over all edges and finding the closest of the eligible ones.

[originally from svn r9108]
This commit is contained in:
Simon Tatham
2011-02-24 19:06:48 +00:00
parent 53f6e4c6cb
commit 621649491d
2 changed files with 5 additions and 68 deletions

5
grid.h
View File

@ -57,11 +57,6 @@ typedef struct grid {
int num_edges; grid_edge *edges;
int num_dots; grid_dot *dots;
/* Should be a face roughly near the middle of the grid.
* Used to seed path-generation, and also for nearest-edge
* detection. */
grid_face *middle_face;
/* Cache the bounding-box of the grid, so the drawing-code can quickly
* figure out the proper scaling to draw onto a given area. */
int lowest_x, lowest_y, highest_x, highest_y;