diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-11-06 15:07:40 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-11-06 15:07:40 +0000 |
commit | 9dfa6e334ab7c5175473aa252ea7846202665918 (patch) | |
tree | 887b22625a396d06e0225f338bfdcb773daf979b /map.c | |
parent | fix indent (diff) | |
download | w3m-9dfa6e334ab7c5175473aa252ea7846202665918.tar.gz w3m-9dfa6e334ab7c5175473aa252ea7846202665918.zip |
[w3m-dev 03383] Select the nearest map area as default.
* fm.h (MapArea): add center_x, center_y
* map.c (nearestMapArea): added
(follow_map_menu): initial by nearestMapArea()
(newMapArea): set center_x, center_y
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to 'map.c')
-rw-r--r-- | map.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $Id: map.c,v 1.12 2002/11/06 15:08:06 ukai Exp $ */ +/* $Id: map.c,v 1.11 2002/11/06 15:07:40 ukai Exp $ */ /* * client-side image maps */ @@ -64,7 +64,7 @@ nearestMapArea(MapList *ml, int x, int y) ListItem *al; MapArea *a; int i, l, n = 0, min = -1, limit = pixel_per_char * pixel_per_char - + pixel_per_line * pixel_per_line; + + pixel_per_line * pixel_per_line; if (!ml || !ml->area) return n; @@ -72,7 +72,7 @@ nearestMapArea(MapList *ml, int x, int y) a = (MapArea *) al->ptr; if (a) { l = (a->center_x - x) * (a->center_x - x) - + (a->center_y - y) * (a->center_y - y); + + (a->center_y - y) * (a->center_y - y); if ((min < 0 || l < min) && l < limit) { n = i; min = l; |