From 00c6c9c8f292ccf18180123fd279f110f4614d4f Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Tue, 31 Oct 2023 14:25:36 +0100 Subject: [PATCH] Implement `@head.fill` with `@headshape="diammond"`. Closes #2837 --- src/note.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/note.cpp b/src/note.cpp index 08197b68362..ae0175f3ea1 100644 --- a/src/note.cpp +++ b/src/note.cpp @@ -549,8 +549,14 @@ char32_t Note::GetNoteheadGlyph(const int duration) const // case HEADSHAPE_circle: return SMUFL_E0B3_noteheadCircleX; case HEADSHAPE_plus: return SMUFL_E0AF_noteheadPlusBlack; case HEADSHAPE_diamond: { - if (DUR_4 > duration) return SMUFL_E0D9_noteheadDiamondHalf; - return SMUFL_E0DB_noteheadDiamondBlack; + if (duration < DUR_4) { + return (this->GetHeadFill() == FILL_solid) ? SMUFL_E0DB_noteheadDiamondBlack + : SMUFL_E0D9_noteheadDiamondHalf; + } + else { + return (this->GetHeadFill() == FILL_void) ? SMUFL_E0D9_noteheadDiamondHalf + : SMUFL_E0DB_noteheadDiamondBlack; + } } // case HEADSHAPE_isotriangle: return SMUFL_E0BC_noteheadTriangleUpHalf; // case HEADSHAPE_oval: return SMUFL_noteheadOval;