mirror of
https://github.com/cookiengineer/audacity
synced 2025-04-29 23:29:41 +02:00
Redundant state removed
(cherry picked from audacity commit 068ef4c36f23db9c825b0f38debb626499110867) Signed-off-by: akleja <storspov@gmail.com>
This commit is contained in:
parent
54fe74896b
commit
b482f8308c
@ -137,8 +137,6 @@ void LabelGlyphHandle::HandleGlyphClick
|
||||
|
||||
if (hit.mIsAdjustingLabel)
|
||||
{
|
||||
// No to the above! We initially expect to be moving just one edge.
|
||||
hit.mbIsMoving = false;
|
||||
|
||||
double t = 0.0;
|
||||
|
||||
@ -168,11 +166,14 @@ void LabelGlyphHandle::HandleGlyphClick
|
||||
// If we're on a boundary between two different labels,
|
||||
// then it's an adjust.
|
||||
// In both cases the two points coalesce.
|
||||
hit.mbIsMoving = (hit.mMouseOverLabelLeft == hit.mMouseOverLabelRight);
|
||||
|
||||
//
|
||||
// NOTE: seems that it's not neccessary that hitting the both
|
||||
// left and right handles mean that we're dealing with a point,
|
||||
// but the range will be turned into a point on click
|
||||
bool isPointLabel = hit.mMouseOverLabelLeft == hit.mMouseOverLabelRight;
|
||||
// Except! We don't coalesce if both ends are from the same label and
|
||||
// we have deliberately chosen to preserve length, by holding shift down.
|
||||
if (!(hit.mbIsMoving && evt.ShiftDown()))
|
||||
if (!(isPointLabel && evt.ShiftDown()))
|
||||
{
|
||||
MayAdjustLabel(hit, hit.mMouseOverLabelLeft, -1, false, t);
|
||||
MayAdjustLabel(hit, hit.mMouseOverLabelRight, 1, false, t);
|
||||
@ -218,13 +219,6 @@ UIHandle::Result LabelGlyphHandle::Click
|
||||
// redraw the track.
|
||||
result |= RefreshCode::RefreshCell;
|
||||
|
||||
// handle shift+ctrl down
|
||||
/*if (event.ShiftDown()) { // && event.ControlDown()) {
|
||||
lTrack->SetHighlightedByKey(true);
|
||||
Refresh(false);
|
||||
return;
|
||||
}*/
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,6 @@ struct LabelTrackHit
|
||||
int mMouseOverLabel{ -1 }; /// Keeps track of which (ranged) label the mouse is currently over.
|
||||
int mMouseOverLabelLeft{ -1 }; /// Keeps track of which left label the mouse is currently over.
|
||||
int mMouseOverLabelRight{ -1 }; /// Keeps track of which right label the mouse is currently over.
|
||||
bool mbIsMoving {};
|
||||
bool mIsAdjustingLabel {};
|
||||
|
||||
std::shared_ptr<LabelTrack> mpLT {};
|
||||
|
Loading…
x
Reference in New Issue
Block a user