summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2004-04-12 22:04:51 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2004-04-12 22:04:51 +0000
commit226f3efbe8f530a4c46c0c30d91cb00c63c1c41e (patch)
tree93520bf83f4361f154edddf57a45b9932e261097
parentd0a3543e727cd67325bcff51b171d684d54d5f0f (diff)
downloadnetsurf-226f3efbe8f530a4c46c0c30d91cb00c63c1c41e.tar.gz
netsurf-226f3efbe8f530a4c46c0c30d91cb00c63c1c41e.tar.bz2
[project @ 2004-04-12 22:04:51 by jmb]
Fix calculation of string width svn path=/import/netsurf/; revision=767
-rw-r--r--riscos/history.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/riscos/history.c b/riscos/history.c
index 55d2ab476..112727810 100644
--- a/riscos/history.c
+++ b/riscos/history.c
@@ -497,12 +497,9 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer)
he = ro_gui_history_click_find(history_current->start, x, y);
if (he) {
/* get width of string */
- xfont_scan_string(history_font, he->url,
- font_GIVEN_FONT | font_KERN | font_GIVEN_LENGTH,
- 0x7fffffff, 0x7fffffff,
- 0,
- 0, strlen(he->url) > 256 ? 256 : strlen(he->url),
- 0, (int*)&width, 0, 0);
+ xwimptextop_string_width(he->url,
+ strlen(he->url) > 256 ? 256 : strlen(he->url),
+ (int*)&width);
ro_gui_set_icon_string(dialog_tooltip, 0, he->url);
@@ -512,20 +509,20 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer)
wimp_get_icon_state(&ic);
wimp_resize_icon(dialog_tooltip, 0,
ic.icon.extent.x0, ic.icon.extent.y0,
- width/200, ic.icon.extent.y1);
+ width + 16, ic.icon.extent.y1);
state.w = dialog_tooltip;
wimp_get_window_state(&state);
/* update window extent */
- box.x1 = width/200;
+ box.x1 = width + 16;
box.y0 = -36;
xwimp_set_extent(dialog_tooltip, &box);
/* set visible area */
state.visible.x0 = pointer->pos.x + 24;
state.visible.y0 = pointer->pos.y - 22 - 36;
- state.visible.x1 = pointer->pos.x + width/200;
+ state.visible.x1 = pointer->pos.x + 24 + width + 16;
state.visible.y1 = pointer->pos.y - 22;
state.next = wimp_TOP;
/* open window */