Skip to content

Commit

Permalink
Different solution
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-spa committed Mar 20, 2023
1 parent a40e534 commit f639597
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/engraving/libmscore/engravingitem.cpp
Expand Up @@ -55,6 +55,7 @@
#include "mscore.h"
#include "note.h"
#include "page.h"
#include "rest.h"
#include "score.h"
#include "segment.h"
#include "shape.h"
Expand Down Expand Up @@ -2704,6 +2705,16 @@ double EngravingItem::computePadding(const EngravingItem* nextItem) const
double scaling = (mag() + nextItem->mag()) / 2;
double padding = score()->paddingTable().at(type()).at(nextItem->type());
padding *= scaling;
if (!isLedgerLine() && nextItem->isRest()) {
const Rest* rest = toRest(nextItem);
SymId symbol = rest->sym();
if (symbol == SymId::restWholeLegerLine
|| symbol == SymId::restDoubleWholeLegerLine
|| symbol == SymId::restHalfLegerLine) {
// In this case the ledgerLine is included in the glyph itself, so we must ignore it
padding += rest->bbox().left();
}
}
return padding;
}
}

0 comments on commit f639597

Please sign in to comment.