summaryrefslogtreecommitdiff
path: root/desktop/textarea.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2010-12-15 15:10:15 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2010-12-15 15:10:15 +0000
commit4b64e921946c0856793799a34d820140e94431ba (patch)
tree4bf7c4a3e23b70342d22d8acc53d1b2660893fa5 /desktop/textarea.c
parentb037763e6e5c9828c547f0b7aa77527bdf114b7b (diff)
downloadnetsurf-4b64e921946c0856793799a34d820140e94431ba.tar.gz
netsurf-4b64e921946c0856793799a34d820140e94431ba.tar.bz2
Only draw caret if there is no selection.
svn path=/trunk/netsurf/; revision=11060
Diffstat (limited to 'desktop/textarea.c')
-rw-r--r--desktop/textarea.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/desktop/textarea.c b/desktop/textarea.c
index 43e3df688..4e0f22548 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -897,10 +897,16 @@ void textarea_redraw(struct text_area *ta, int x, int y,
&ta->fstyle);
}
- if (x + ta->caret_x >= clip_x0 && x + ta->caret_x <= clip_x1) {
+ if ((ta->selection_end == -1 ||
+ ta->selection_start == ta->selection_end) &&
+ x + ta->caret_x >= clip_x0 &&
+ x + ta->caret_x <= clip_x1) {
+ /* There is no selection and caret is in horizontal
+ * clip range. */
int caret_height = ta->line_height - 1;
y += ta->caret_y + vertical_offset;
if (y + caret_height >= clip_y0 && y <= clip_y1)
+ /* Caret in vertical clip range; plot */
plot.line(x + ta->caret_x, y + ta->caret_y,
x + ta->caret_x,
y + ta->caret_y + ta->line_height,