Fix selection status

This commit is contained in:
Matthias Neeracher 2011-09-08 04:09:24 +02:00
parent b8e4c614f3
commit 09c3d25dcf
2 changed files with 5 additions and 2 deletions

View File

@ -838,21 +838,24 @@ const float kSemiFloor = -1.0f*kLineH;
- (void) mouseDown:(NSEvent *)event - (void) mouseDown:(NSEvent *)event
{ {
fSelEnd = -1;
switch ([self findRegionForEvent:event]) { switch ([self findRegionForEvent:event]) {
case kRegionNote: case kRegionNote:
fSelEnd = -1;
[self addNoteAtCursor]; [self addNoteAtCursor];
break; break;
case kRegionChord: case kRegionChord:
fSelEnd = -1;
[self editChord]; [self editChord];
break; break;
case kRegionLyrics: case kRegionLyrics:
fSelEnd = -1;
[self editLyrics]; [self editLyrics];
break; break;
case kRegionMeasure: case kRegionMeasure:
[self editSelection:([event modifierFlags] & NSShiftKeyMask) != 0]; [self editSelection:([event modifierFlags] & NSShiftKeyMask) != 0];
break; break;
default: default:
fSelEnd = -1;
break; break;
} }
} }

View File

@ -111,7 +111,7 @@ VLSequenceCallback(
- (void)editSelection:(BOOL)extend - (void)editSelection:(BOOL)extend
{ {
if (extend && fSelStart > -1) { if (extend && fSelEnd > -1) {
if (fCursorMeasure > fSelEnd) if (fCursorMeasure > fSelEnd)
fSelEnd = fCursorMeasure; fSelEnd = fCursorMeasure;
else if (fCursorMeasure < fSelStart) else if (fCursorMeasure < fSelStart)