Fix selection issues with visual tools

Originally committed to SVN as r4622.
This commit is contained in:
Thomas Goyne 2010-06-27 07:53:25 +00:00
parent 7f7771bcdc
commit 75d9ecd14a
2 changed files with 5 additions and 2 deletions

View file

@ -238,7 +238,9 @@ void BaseGrid::SelectRow(int row, bool addToSelected, bool select) {
if (!addToSelected) { if (!addToSelected) {
Selection old_selection(selection); Selection old_selection(selection);
selection.clear(); selection.clear();
selection.insert(line); if (select) {
selection.insert(line);
}
AnnounceSelectedSetChanged(selection, old_selection); AnnounceSelectedSetChanged(selection, old_selection);
} }

View file

@ -382,7 +382,8 @@ wxArrayInt VisualTool<FeatureType>::GetSelection() {
template<class FeatureType> template<class FeatureType>
void VisualTool<FeatureType>::ClearSelection(bool hard) { void VisualTool<FeatureType>::ClearSelection(bool hard) {
if (hard) { if (hard) {
VideoContext::Get()->grid->SelectRow(0, false, false); Selection sel;
VideoContext::Get()->grid->SetSelectedSet(sel);
} }
selFeatures.clear(); selFeatures.clear();
lineSelCount.clear(); lineSelCount.clear();