1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-02 16:49:41 +02:00

Fix for bug# 1535: some text can be selected when tabbing to label

Problem was that mInitialCursorPos was not being set when tabbing to a label.
This commit is contained in:
David Bailes 2016-10-25 11:43:08 +01:00
parent ff9763f984
commit cf547077d5

View File

@ -1870,6 +1870,7 @@ bool LabelTrack::OnKeyDown(SelectedRegion &newSel, wxKeyEvent & event)
if (mSelIndex >= 0 && mSelIndex < (int)mLabels.size()) {
LabelStruct &newLabel = mLabels[mSelIndex];
mCurrentCursorPos = newLabel.title.Length();
mInitialCursorPos = mCurrentCursorPos;
//Set the selection region to be equal to the selection bounds of the tabbed-to label.
newSel = newLabel.selectedRegion;
}
@ -1921,6 +1922,7 @@ bool LabelTrack::OnKeyDown(SelectedRegion &newSel, wxKeyEvent & event)
if (mSelIndex >= 0 && mSelIndex < len) {
const auto &labelStruct = mLabels[mSelIndex];
mCurrentCursorPos = labelStruct.title.Length();
mInitialCursorPos = mCurrentCursorPos;
//Set the selection region to be equal to the selection bounds of the tabbed-to label.
newSel = labelStruct.selectedRegion;
}