From 660c8ad236a88bb12de980dfade2b85ba104d85a Mon Sep 17 00:00:00 2001 From: Aaron Sattely Date: Tue, 23 Nov 2021 14:46:15 -0500 Subject: [PATCH] Fix computation of smallness for tuplets Tuplets will now be small if all containing elements are either 1) small chordrests or 2) tuplets with all small chordrests or tuplets --- src/engraving/libmscore/tuplet.cpp | 8 ++++---- src/engraving/libmscore/tuplet.h | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/engraving/libmscore/tuplet.cpp b/src/engraving/libmscore/tuplet.cpp index 8f12b1cdc9025..78bf8e030b527 100644 --- a/src/engraving/libmscore/tuplet.cpp +++ b/src/engraving/libmscore/tuplet.cpp @@ -206,14 +206,14 @@ void Tuplet::layout() _number->setXmlText(QString("%1:%2").arg(_ratio.numerator()).arg(_ratio.denominator())); } - bool isSmall = true; + _isSmall = true; for (const DurationElement* e : _elements) { - if (e->isChordRest() && !toChordRest(e)->isSmall()) { - isSmall = false; + if ((e->isChordRest() && !toChordRest(e)->isSmall()) || (e->isTuplet() && !toTuplet(e)->isSmall())) { + _isSmall = false; break; } } - _number->setMag(isSmall ? score()->styleD(Sid::smallNoteMag) : 1.0); + _number->setMag(_isSmall ? score()->styleD(Sid::smallNoteMag) : 1.0); } else { if (_number) { if (_number->selected()) { diff --git a/src/engraving/libmscore/tuplet.h b/src/engraving/libmscore/tuplet.h index 1d440dbf52264..a7425783651cc 100644 --- a/src/engraving/libmscore/tuplet.h +++ b/src/engraving/libmscore/tuplet.h @@ -55,6 +55,7 @@ class Tuplet final : public DurationElement TDuration _baseLen; // 1/8 for a triplet of 1/8 bool _isUp; + bool _isSmall; Fraction _tick; @@ -138,6 +139,7 @@ class Tuplet final : public DurationElement void setDirection(Direction d) { _direction = d; } Direction direction() const { return _direction; } bool isUp() const { return _isUp; } + bool isSmall() const { return _isSmall; } Fraction tick() const override { return _tick; } Fraction rtick() const override; void setTick(const Fraction& v) { _tick = v; }