[Freeciv-Dev] Re: remove nearest_real_pos uses (PR#1211)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Raimar Falke wrote:
On Mon, Jan 07, 2002 at 02:39:16AM -0800, jdorje@xxxxxxxxxxxxxxxxxxxxx wrote:
If this patch is applied, the only remaining nearest_real_pos use will
be in map_pos_to_canvas_pos in mapview_common. If one of these places
does need to use nearest_real_pos (which seems inconceivable), a comment
should be added explaining why.
Can't nearest_real_pos then be moved into mapview_common? So nobody
can use this "dangerous tool". However this would spread topology
knowledge (which is also bad). What about just ignoring clicks which
are outside the map?
nearest_real_pos contains topology information, and so should remain in
map.[ch] (or map_topology.[ch]). This has been the a large part of the
point of most of my changes over recent months.
Ignoring clicks that are outside the map is quite reasonable, but will
change the behavior of the program. This actually does more than affect
the centering of the mapview; it causes any unreal click to be converted
to a real one. This has many effects, some good but most not. A short
sampling:
- Clicking on an unreal tile to center the map centers on the
nearest_real_pos.
- Moving the mouse over an unreal tile while in goto mode gotos to
the nearest_real_pos.
- Center-clicking an an unreal tile pops up the tile information for
the nearest_real_pos.
- Activating the city grid ('t') and shift-clicking on an unreal tile
counts as shift-clicking on the nearest_real_pos.
These effects can be fixed by returning the realness of the position, as
Ross has proposed, or by doing the same without calling nearest_real_pos
(in which case we rely on it to be called on a case-by-case behavior
later). But not calling nearest_real_pos would change the behavior of
_all_ mouse clicks for _all_ GUI's, which is a non-trivial change.
I agree it is reasonable to move SAFE_MAPSTEP into tilespec.c, and will
make things safer.
jason
|
|