From 1aa01f95869bae53f52a501b7970977c6963f8cc Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sun, 11 Oct 2009 05:45:27 +0000 Subject: Fix bug #2871358 where left or right key with rectangular selection moved to a left or right of main selection rather than before or after rectangular selection. --- src/Selection.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Selection.h') diff --git a/src/Selection.h b/src/Selection.h index b0c286866..d064af642 100644 --- a/src/Selection.h +++ b/src/Selection.h @@ -74,6 +74,12 @@ struct SelectionSegment { bool Empty() const { return start == end; } + void Extend(SelectionPosition p) { + if (start > p) + start = p; + if (end < p) + end = p; + } }; struct SelectionRange { @@ -141,6 +147,7 @@ public: int MainCaret() const; int MainAnchor() const; SelectionRange &Rectangular(); + SelectionSegment Limits() const; size_t Count() const; size_t Main() const; void SetMain(size_t r); -- cgit v1.2.3