From 9dfa6e334ab7c5175473aa252ea7846202665918 Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Wed, 6 Nov 2002 15:07:40 +0000 Subject: [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 --- ChangeLog | 10 +++++++++- fm.h | 4 +++- map.c | 6 +++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3309991..3d03158 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-11-07 Hironori SAKAMOTO + + * [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 + 2002-11-07 Hironori SAKAMOTO * [w3m-dev 03382] Interrupt in no_proxy_check() @@ -4365,4 +4373,4 @@ a * [w3m-dev 03276] compile error on EWS4800 * release-0-2-1 * import w3m-0.2.1 -$Id: ChangeLog,v 1.482 2002/11/06 15:03:25 ukai Exp $ +$Id: ChangeLog,v 1.483 2002/11/06 15:07:40 ukai Exp $ diff --git a/fm.h b/fm.h index caaa084..f6f0019 100644 --- a/fm.h +++ b/fm.h @@ -1,4 +1,4 @@ -/* $Id: fm.h,v 1.70 2002/11/05 17:54:39 ukai Exp $ */ +/* $Id: fm.h,v 1.71 2002/11/06 15:07:40 ukai Exp $ */ /* * w3m: WWW wo Miru utility * @@ -292,6 +292,8 @@ typedef struct _MapArea { char shape; short *coords; int ncoords; + short center_x; + short center_y; #endif #endif } MapArea; diff --git a/map.c b/map.c index bc1b1f6..9b5db54 100644 --- a/map.c +++ b/map.c @@ -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; -- cgit v1.2.3