Skip to content

Commit

Permalink
Merge pull request #16967 from bakajikara/first-system-indentation
Browse files Browse the repository at this point in the history
Fix #15638: Ignore hidden names on first system
  • Loading branch information
RomanPudashkin committed May 10, 2023
2 parents 49a2873 + b0b10ea commit c7d273c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/engraving/libmscore/system.cpp
Expand Up @@ -269,13 +269,13 @@ void System::adjustStavesNumber(size_t nstaves)
// instrumentNamesWidth
//---------------------------------------------------------

double System::instrumentNamesWidth()
double System::instrumentNamesWidth(const bool isFirstSystem)
{
double namesWidth = 0.0;

for (staff_idx_t staffIdx = 0; staffIdx < score()->nstaves(); ++staffIdx) {
const SysStaff* staff = this->staff(staffIdx);
if (!staff) {
if (!staff || (isFirstSystem && !staff->show())) {
continue;
}

Expand Down Expand Up @@ -459,7 +459,7 @@ void System::layoutSystem(LayoutContext& ctx, double xo1, const bool isFirstSyst
layoutBrackets(ctx);
double maxBracketsWidth = totalBracketOffset(ctx);

double maxNamesWidth = instrumentNamesWidth();
double maxNamesWidth = instrumentNamesWidth(isFirstSystem);

double indent = maxNamesWidth > 0 ? maxNamesWidth + instrumentNameOffset : 0.0;
if (isFirstSystem && firstSystemIndent) {
Expand Down
2 changes: 1 addition & 1 deletion src/engraving/libmscore/system.h
Expand Up @@ -122,7 +122,7 @@ class System final : public EngravingItem
Bracket* createBracket(const LayoutContext& ctx, BracketItem* bi, size_t column, staff_idx_t staffIdx, std::vector<Bracket*>& bl,
Measure* measure);

double instrumentNamesWidth();
double instrumentNamesWidth(const bool isFirstSystem);
double layoutBrackets(const LayoutContext& ctx);
static double totalBracketOffset(LayoutContext& ctx);

Expand Down

0 comments on commit c7d273c

Please sign in to comment.