Skip to content

Commit

Permalink
Draw anchors at staff bottom if element is placed below
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrio95 committed Mar 18, 2020
1 parent 55ad880 commit c2e06ae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion libmscore/element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2024,7 +2024,10 @@ QVector<QLineF> Element::genericDragAnchorLines() const
qreal yp;
if (parent()->isSegment()) {
System* system = toSegment(parent())->measure()->system();
yp = system->staffCanvasYpage(staffIdx());
const int stIdx = staffIdx();
yp = system->staffCanvasYpage(stIdx);
if (placement() == Placement::BELOW)
yp += system->staff(stIdx)->bbox().height();
}
else
yp = parent()->canvasPos().y();
Expand Down
11 changes: 9 additions & 2 deletions libmscore/line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,15 @@ QVector<QLineF> LineSegment::gripAnchorLines(Grip grip) const
return result;

// note-anchored spanners are relative to the system
qreal y = spanner()->anchor() == Spanner::Anchor::NOTE ?
system()->pos().y() : system()->staffYpage(staffIdx());
qreal y;
if (spanner()->anchor() == Spanner::Anchor::NOTE)
y = system()->pos().y();
else {
const int stIdx = staffIdx();
y = system()->staffYpage(stIdx);
if (line()->placement() == Placement::BELOW)
y += system()->staff(stIdx)->bbox().height();
}

switch (grip) {
case Grip::START:
Expand Down

0 comments on commit c2e06ae

Please sign in to comment.