Skip to content

Commit f01873d

Browse files
committed
More precise calculation of harmonie's top
1 parent ad3c6f3 commit f01873d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/engraving/rendering/score/tlayout.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,12 +1542,11 @@ void TLayout::layoutFBox(const FBox* item, FBox::LayoutData* ldata, const Layout
15421542
RectF fretRect = fretDiagram->ldata()->bbox();
15431543

15441544
const Harmony::LayoutData* harmonyLdata = fretDiagram->harmony()->ldata();
1545-
RectF harmonyRect = harmonyLdata->bbox();
1546-
harmonyRect.moveTo(harmonyLdata->pos());
1545+
RectF harmonyRect = harmonyLdata->bbox().translated(harmonyLdata->pos());
15471546

15481547
double height = fretRect.united(harmonyRect).height();
15491548
maxRowHeight = std::max(maxRowHeight, height);
1550-
maxHarmonyHeight = std::max(maxHarmonyHeight, harmonyRect.height());
1549+
maxHarmonyHeight = std::max(maxHarmonyHeight, -harmonyRect.top());
15511550
harmonyBaseline = std::max(harmonyBaseline, fretDiagram->harmony()->baseLine());
15521551
}
15531552

@@ -1574,8 +1573,6 @@ void TLayout::layoutFBox(const FBox* item, FBox::LayoutData* ldata, const Layout
15741573
: alignH == AlignH::RIGHT ? width - totalTableWidth : 0.0;
15751574
const double startY = topMargin;
15761575

1577-
const double shapeMarginAboveDiagram = ctx.conf().styleMM(Sid::harmonyFretDist).val() * 1.5;
1578-
15791576
double bottomY = 0.0;
15801577

15811578
for (size_t i = 0; i < totalDiagrams; ++i) {
@@ -1607,7 +1604,7 @@ void TLayout::layoutFBox(const FBox* item, FBox::LayoutData* ldata, const Layout
16071604
harmony->mutldata()->moveY(-(harmonyBaselines[row]) + baseLineAdjust);
16081605

16091606
double fretDiagramX = x;
1610-
double fretDiagramY = y + harmonyHeights[row] + shapeMarginAboveDiagram;
1607+
double fretDiagramY = y + harmonyHeights[row];
16111608

16121609
fretDiagram->mutldata()->setPos(PointF(fretDiagramX, fretDiagramY));
16131610

0 commit comments

Comments
 (0)