Skip to content

Commit

Permalink
Merge branch 'bug1704'
Browse files Browse the repository at this point in the history
  • Loading branch information
tedfelix committed Oct 21, 2024
2 parents 6658544 + 76e24f4 commit c006f77
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
16 changes: 12 additions & 4 deletions src/gui/editors/notation/NotationScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1175,12 +1175,20 @@ NotationScene::getCursorCoordinates(timeT t) const
CursorCoordinates cc;
cc.allStaffs = QLineF(top.first, top.second,
bottom.first, bottom.second);
//cc.currentStaff = QLineF(singleTop.first, singleTop.second,
// singleBottom.first, singleBottom.second);
//cc.currentStaff = QLineF(top.first, top.second,
// bottom.first, bottom.second);

// if the time is within the current segment we take the
// singleTop/Bottom cursor for time accuracy within that
// segment. If the time is outside the current segment we just use
// the top/bottom x coordinate to avoid the cursor jumping to the
// current segment.
cc.currentStaff = QLineF(top.first, singleTop.second,
bottom.first, singleBottom.second);
if (currentStaff && currentStaff->includesTime(t)) {
// take the cursor position caluclated from the layout
cc.currentStaff = QLineF(singleTop.first, singleTop.second,
singleBottom.first, singleBottom.second);
}

return cc;
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/editors/notation/NotationStaff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1979,7 +1979,7 @@ NotationStaff::makeViewElement(Rosegarden::Event* e)
}

bool
NotationStaff::includesTime(timeT t)
NotationStaff::includesTime(timeT t) const
{
Composition *composition = getSegment().getComposition();

Expand Down
2 changes: 1 addition & 1 deletion src/gui/editors/notation/NotationStaff.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class NotationStaff : public QObject, // Just for tr(). Could be cleaned up.
*/
timeT getTimeAtSceneCoords(double cx, int cy) const;

bool includesTime(timeT t);
bool includesTime(timeT t) const;

timeT getStartTime() const;

Expand Down

0 comments on commit c006f77

Please sign in to comment.