Skip to content

Commit

Permalink
fix #275382: Tuplet numbers are incorrectly positioned
Browse files Browse the repository at this point in the history
Add new position of tuplet number.

Set default font of the number in tuplet to italic
  • Loading branch information
handrok committed Aug 30, 2018
1 parent 209b5c7 commit 7a8e88d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions libmscore/tuplet.cpp
Expand Up @@ -137,8 +137,9 @@ void Tuplet::layout()
_number->setTrack(track());
_number->setParent(this);
_number->setVisible(visible());
for (auto p : { Pid::FONT_FACE, Pid::FONT_SIZE, Pid::FONT_BOLD, Pid::FONT_ITALIC, Pid::FONT_UNDERLINE, Pid::ALIGN })
for (auto p : { Pid::FONT_FACE, Pid::FONT_SIZE, Pid::FONT_BOLD, Pid::FONT_UNDERLINE, Pid::ALIGN })
_number->resetProperty(p);
_number->setProperty(Pid::FONT_ITALIC, true);
}
if (_numberType == TupletNumberType::SHOW_NUMBER)
_number->setXmlText(QString("%1").arg(_ratio.numerator()));
Expand Down Expand Up @@ -508,7 +509,7 @@ void Tuplet::layout()
_number->layout();
numberWidth = _number->bbox().width();

qreal y3 = p1.y() + (p2.y() - p1.y()) * .5 - l1 * (_isUp ? 1.0 : -1.0);
qreal y3 = p1.y() + (p2.y() - p1.y()) * .5 - l1 * (_isUp ? 1.0 : -1.0) - _number->bbox().height() / 2;
//
// for beamed tuplets, center number on beam
//
Expand Down Expand Up @@ -538,11 +539,11 @@ void Tuplet::layout()
if (_number) {
bracketL[0] = QPointF(p1.x(), p1.y());
bracketL[1] = QPointF(p1.x(), p1.y() - l1);
qreal x = x3 - numberWidth * .5 - _spatium * .5;
qreal x = x3 - numberWidth * .25 - _spatium * .5;
qreal y = p1.y() + (x - p1.x()) * slope;
bracketL[2] = QPointF(x, y - l1);

x = x3 + numberWidth * .5 + _spatium * .5;
x = x3 + numberWidth * 1.25 + _spatium * .5;
y = p1.y() + (x - p1.x()) * slope;
bracketR[0] = QPointF(x, y - l1);
bracketR[1] = QPointF(p2.x(), p2.y() - l1);
Expand All @@ -559,11 +560,11 @@ void Tuplet::layout()
if (_number) {
bracketL[0] = QPointF(p1.x(), p1.y());
bracketL[1] = QPointF(p1.x(), p1.y() + l1);
qreal x = x3 - numberWidth * .5 - _spatium * .5;
qreal x = x3 - numberWidth * .25 - _spatium * .5;
qreal y = p1.y() + (x - p1.x()) * slope;
bracketL[2] = QPointF(x, y + l1);

x = x3 + numberWidth * .5 + _spatium * .5;
x = x3 + numberWidth * 1.25 + _spatium * .5;
y = p1.y() + (x - p1.x()) * slope;
bracketR[0] = QPointF(x, y + l1);
bracketR[1] = QPointF(p2.x(), p2.y() + l1);
Expand Down
2 changes: 1 addition & 1 deletion vtest/gen.bat
Expand Up @@ -41,7 +41,7 @@ set SRC=mmrest-1,bravura-mmrest,gonville-mmrest,mmrest-2,mmrest-4,mmrest-5,mmres
IF NOT "%1"=="" (
SET INSTALL_PATH=%1
) ELSE (
SET INSTALL_PATH=msvc.install
SET INSTALL_PATH=msvc.install_x64
)

set MSCORE=..\%INSTALL_PATH%\bin\musescore.exe
Expand Down

0 comments on commit 7a8e88d

Please sign in to comment.