From 05dca28d582a1b98ea9c5f8fce96e13045977926 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 29 Mar 2008 22:26:04 +0000 Subject: Selection adjustments always change the selection end when click is inside the existing selection. svn path=/trunk/netsurf/; revision=4059 --- desktop/selection.c | 8 ++------ desktop/selection.h | 1 - 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'desktop') diff --git a/desktop/selection.c b/desktop/selection.c index e50689f48..ecfb2c187 100644 --- a/desktop/selection.c +++ b/desktop/selection.c @@ -188,7 +188,6 @@ void selection_init(struct selection *s, struct box *root) s->defined = false; s->start_idx = 0; s->end_idx = 0; - s->last_was_end = true; s->drag_state = DRAG_NONE; selection_reinit(s, root); @@ -277,7 +276,7 @@ bool selection_click(struct selection *s, browser_mouse_state mouse, unsigned id if (!selection_defined(s)) return false; /* ignore Adjust drags */ - if (pos > 0 || (!pos && s->last_was_end)) { + if (pos >= 0) { selection_set_end(s, idx); s->drag_state = DRAG_END; @@ -301,7 +300,7 @@ bool selection_click(struct selection *s, browser_mouse_state mouse, unsigned id if (!selection_defined(s)) return false; - if (pos > 0 || (!pos && s->last_was_end)) + if (pos >= 0) selection_set_end(s, idx); else selection_set_start(s, idx); @@ -622,7 +621,6 @@ void selection_clear(struct selection *s, bool redraw) s->defined = false; s->start_idx = 0; s->end_idx = 0; - s->last_was_end = true; if (redraw && was_defined) selection_redraw(s, old_start, old_end); @@ -672,7 +670,6 @@ void selection_set_start(struct selection *s, unsigned offset) unsigned old_start = s->start_idx; s->start_idx = offset; - s->last_was_end = false; s->defined = (s->start_idx < s->end_idx); if (was_defined) { @@ -699,7 +696,6 @@ void selection_set_end(struct selection *s, unsigned offset) unsigned old_end = s->end_idx; s->end_idx = offset; - s->last_was_end = true; s->defined = (s->start_idx < s->end_idx); if (was_defined) { diff --git a/desktop/selection.h b/desktop/selection.h index 0541357ea..706286766 100644 --- a/desktop/selection.h +++ b/desktop/selection.h @@ -49,7 +49,6 @@ struct selection unsigned end_idx; bool defined; - bool last_was_end; seln_drag_state drag_state; }; -- cgit v1.2.3