aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Selection.h
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2009-07-08 10:02:07 +0000
committernyamatongwe <devnull@localhost>2009-07-08 10:02:07 +0000
commit00a99b814014f00cea5c64f205b8a701a8b69b58 (patch)
tree261a3e48203901fceca58d2a1ed539c93104bce9 /src/Selection.h
parentc6fefca9f746db86605e4a9c6a8b76423d570f0b (diff)
downloadscintilla-mirror-00a99b814014f00cea5c64f205b8a701a8b69b58.tar.gz
Draw discontiguous and virtual space selection in non-alpha mode.
Diffstat (limited to 'src/Selection.h')
-rw-r--r--src/Selection.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/Selection.h b/src/Selection.h
index 94d6fc65e..0cb1200f8 100644
--- a/src/Selection.h
+++ b/src/Selection.h
@@ -56,6 +56,26 @@ public:
}
};
+// Ordered range to make drawing simpler
+struct SelectionSegment {
+ SelectionPosition start;
+ SelectionPosition end;
+ SelectionSegment() {
+ }
+ SelectionSegment(SelectionPosition a, SelectionPosition b) {
+ if (a < b) {
+ start = a;
+ end = b;
+ } else {
+ start = b;
+ end = a;
+ }
+ }
+ bool Empty() const {
+ return start == end;
+ }
+};
+
struct SelectionRange {
SelectionPosition caret;
SelectionPosition anchor;
@@ -87,7 +107,7 @@ struct SelectionRange {
bool Contains(int pos) const;
bool Contains(SelectionPosition sp) const;
bool ContainsCharacter(int posCharacter) const;
- bool Intersect(int start, int end, SelectionPosition &selStart, SelectionPosition &selEnd) const;
+ SelectionSegment Intersect(SelectionSegment check) const;
SelectionPosition Start() const {
return (anchor < caret) ? anchor : caret;
}