diff --git a/src/view_element.cpp b/src/view_element.cpp index b933e84261..cad7563ea2 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -1539,22 +1539,17 @@ void View::DrawRest(DeviceContext *dc, LayerElement *element, Layer *layer, Staf const bool drawingCueSize = rest->GetDrawingCueSize(); const int staffSize = staff->GetDrawingStaffNotationSize(); data_DURATION drawingDur = rest->GetActualDur(); - if (drawingDur == DURATION_NONE) { - // in tablature the @dur is in the parent TabGrp - if (staff->IsTablature()) { - TabGrp *tabGrp = vrv_cast(rest->GetFirstAncestor(TABGRP)); - if (tabGrp != NULL) { - drawingDur = tabGrp->GetActualDur(); - } - } - - if (drawingDur == DURATION_NONE) { - if (!dc->Is(BBOX_DEVICE_CONTEXT)) { - LogWarning("Missing duration for rest '%s'", rest->GetID().c_str()); - } - drawingDur = DURATION_4; - } + // in tablature the @dur is in the parent TabGrp - try to get if from there + if ((drawingDur == DURATION_NONE) && staff->IsTablature()) { + TabGrp *tabGrp = vrv_cast(rest->GetFirstAncestor(TABGRP)); + if (tabGrp != NULL) drawingDur = tabGrp->GetActualDur(); } + // Make sure we have something to draw + if ((drawingDur == DURATION_NONE) && !dc->Is(BBOX_DEVICE_CONTEXT)) { + LogWarning("Missing duration for rest '%s'", rest->GetID().c_str()); + drawingDur = DURATION_4; + } + const char32_t drawingGlyph = rest->GetRestGlyph(drawingDur); const int x = element->GetDrawingX();