summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2008-03-29 22:26:04 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2008-03-29 22:26:04 +0000
commit05dca28d582a1b98ea9c5f8fce96e13045977926 (patch)
tree04e60f98dee4d6314e231b0318e270a08ac9559f
parent83a83757ab87828e3b5b3e5523979fe6e4daf0fe (diff)
downloadnetsurf-05dca28d582a1b98ea9c5f8fce96e13045977926.tar.gz
netsurf-05dca28d582a1b98ea9c5f8fce96e13045977926.tar.bz2
Selection adjustments always change the selection end when click is inside the existing selection.
svn path=/trunk/netsurf/; revision=4059
-rw-r--r--desktop/selection.c8
-rw-r--r--desktop/selection.h1
2 files changed, 2 insertions, 7 deletions
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;
};