diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2011-09-21 21:11:16 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2011-09-21 21:11:16 +0000 |
commit | c98e37be1fbb88a0080c14216da393e53733c5fb (patch) | |
tree | 759491046a45ddf511006fe84d7671a7acf0b23e /desktop/textinput.c | |
parent | 9f3a082658a979269838d4682f9abfb21a90f679 (diff) | |
download | netsurf-c98e37be1fbb88a0080c14216da393e53733c5fb.tar.gz netsurf-c98e37be1fbb88a0080c14216da393e53733c5fb.tar.bz2 |
Better caret positioning in scrolled frames.
svn path=/trunk/netsurf/; revision=12851
Diffstat (limited to 'desktop/textinput.c')
-rw-r--r-- | desktop/textinput.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/desktop/textinput.c b/desktop/textinput.c index 63e17debe..50ea16cc8 100644 --- a/desktop/textinput.c +++ b/desktop/textinput.c @@ -76,8 +76,15 @@ void browser_window_place_caret(struct browser_window *bw, root_bw = browser_window_get_root(bw); browser_window_get_position(bw, true, &pos_x, &pos_y); - x = x * bw->scale + pos_x; - y = y * bw->scale + pos_y; + if (bw->browser_window_type == BROWSER_WINDOW_FRAME) { + x = (x - scrollbar_get_offset(bw->scroll_x)) * bw->scale; + y = (y - scrollbar_get_offset(bw->scroll_y)) * bw->scale; + x += pos_x; + y += pos_y; + } else { + x = x * bw->scale + pos_x; + y = y * bw->scale + pos_y; + } gui_window_place_caret(root_bw->window, x, y, height * bw->scale); bw->caret_callback = caret_cb; |