Skip to content

Fix GH#28047: Ignore invisible fret diagrams when placing chord symbol #1008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: 3.x
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions libmscore/harmony.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,7 @@ QPoint Harmony::calculateBoundingRect()
const qreal cw = symWidth(SymId::noteheadBlack);
qreal newx = 0.0;
qreal newy = 0.0;
const bool alignToFretDiagram = fd && fd->visible();

if (textList.empty()) {
TextBase::layout1();
Expand All @@ -1387,7 +1388,7 @@ QPoint Harmony::calculateBoundingRect()

qreal xx = 0.0;
qreal yy = 0.0;
if (fd) {
if (alignToFretDiagram) {
if (align() & Align::RIGHT)
xx = fd->width() / 2.0;
yy = rypos();
Expand Down Expand Up @@ -1417,7 +1418,7 @@ QPoint Harmony::calculateBoundingRect()
yy = -bb.height() - bb.y();

qreal xx = -bb.x(); // Align::LEFT
if (fd) {
if (alignToFretDiagram) {
if (align() & Align::RIGHT)
xx = fd->bbox().width() - bb.width();
else if (align() & Align::HCENTER)
Expand Down Expand Up @@ -1455,6 +1456,10 @@ QPoint Harmony::calculateBoundingRect()

}
}
if (fd && !fd->visible()) {
// Translate to base position around note
newx -= fd->pos().x();
}
return QPoint(newx, newy);
}

Expand Down