From d8afa085aba4f6b61f29bee5e896623bb5448605 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Thu, 30 Jul 2009 08:29:43 +0000 Subject: When using Ctrl+Drag for multiple selection when previous selections dragged over but then that area is deselected, reveal the previous selections again. This allows the user to undo some bad effects when the mouse moves further than wanted. --- src/Editor.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Editor.cxx') diff --git a/src/Editor.cxx b/src/Editor.cxx index ee44a6972..caeb9dfdf 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -5644,8 +5644,9 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b SetDragPosition(SelectionPosition(invalidPosition)); if (!shift) { if (ctrl && multipleSelection) { - InvalidateSelection(SelectionRange(newPos), true); - sel.AddSelection(newPos); + SelectionRange range(newPos); + sel.TentativeSelection(range); + InvalidateSelection(range, true); } else { InvalidateSelection(SelectionRange(newPos), true); if (sel.Count() > 1) @@ -5756,8 +5757,7 @@ void Editor::ButtonMove(Point pt) { SetSelection(movePos, sel.RangeMain().anchor); } else if (sel.Count() > 1) { SelectionRange range(movePos, sel.RangeMain().anchor); - sel.TrimSelection(range); - sel.RangeMain() = range; + sel.TentativeSelection(range); InvalidateSelection(range, true); } else { SetSelection(movePos, sel.RangeMain().anchor); @@ -5883,6 +5883,7 @@ void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) { SetSelection(newPos, sel.RangeMain().anchor); } } + sel.CommitTentative(); } SetRectangularRange(); lastClickTime = curTime; -- cgit v1.2.3