Merge pull request #16967 from bakajikara/first-system-indentation

Fix #15638: Ignore hidden names on first system
This commit is contained in:
RomanPudashkin 2023-05-10 13:31:53 +03:00 committed by GitHub
commit c7d273c633
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -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;
}
@ -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) {

View file

@ -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);