aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2005-06-03 23:11:03 +0000
committernyamatongwe <unknown>2005-06-03 23:11:03 +0000
commite01e381431f57574177c75906afda495aca40c91 (patch)
tree7a43ea529c6edae50d63dd92977135e8e0761050 /src
parent30e783fc790bf56ed5480febdc8f01f09ba7dd84 (diff)
downloadscintilla-mirror-e01e381431f57574177c75906afda495aca40c91.tar.gz
Fixed bug 1214067 Alt+Shift+Click not displaying rectangular selection
fully by setting rectangular range in mouse down processing. Hoisted this code into new method SetRectangularRange as used in 4 places.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index b266ef2a5..b56e8f303 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -931,6 +931,13 @@ int Editor::SelectionEnd() {
return Platform::Maximum(currentPos, anchor);
}
+void Editor::SetRectangularRange() {
+ if (selType == selRectangle) {
+ xStartSelect = XFromPosition(anchor);
+ xEndSelect = XFromPosition(currentPos);
+ }
+}
+
void Editor::InvalidateSelection(int currentPos_, int anchor_) {
int firstAffected = anchor;
if (firstAffected > currentPos)
@@ -958,10 +965,7 @@ void Editor::SetSelection(int currentPos_, int anchor_) {
currentPos = currentPos_;
anchor = anchor_;
}
- if (selType == selRectangle) {
- xStartSelect = XFromPosition(anchor);
- xEndSelect = XFromPosition(currentPos);
- }
+ SetRectangularRange();
ClaimSelection();
}
@@ -971,10 +975,7 @@ void Editor::SetSelection(int currentPos_) {
InvalidateSelection(currentPos_, currentPos_);
currentPos = currentPos_;
}
- if (selType == selRectangle) {
- xStartSelect = XFromPosition(anchor);
- xEndSelect = XFromPosition(currentPos);
- }
+ SetRectangularRange();
ClaimSelection();
}
@@ -5070,9 +5071,9 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b
SetEmptySelection(newPos);
}
selType = alt ? selRectangle : selStream;
- xStartSelect = xEndSelect = pt.x - vs.fixedColumnWidth + xOffset;
selectionType = selChar;
originalAnchorPos = currentPos;
+ SetRectangularRange();
}
}
}
@@ -5266,9 +5267,7 @@ void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) {
SetSelection(newPos);
}
}
- // Now we rely on the current pos to compute rectangular selection
- xStartSelect = XFromPosition(anchor);
- xEndSelect = XFromPosition(currentPos);
+ SetRectangularRange();
lastClickTime = curTime;
lastClick = pt;
lastXChosen = pt.x;