Skip to content

Commit

Permalink
Merge pull request #27009 from mike-spa/fixSystemLocksVisualizationBug
Browse files Browse the repository at this point in the history
Fix system locks bug
  • Loading branch information
miiizen authored Mar 10, 2025
2 parents 3a48e31 + 71b7b7c commit 178a36d
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/engraving/rendering/score/systemlayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,19 +450,16 @@ void SystemLayout::layoutSystemLockIndicators(System* system, LayoutContext& ctx
const std::vector<SystemLockIndicator*> lockIndicators = system->lockIndicators();
// In PAGE view, at most ONE lock indicator can exist per system.
assert(lockIndicators.size() <= 1);
system->deleteLockIndicators();

const SystemLock* lock = system->systemLock();
if (!lock) {
system->deleteLockIndicators();
return;
}

SystemLockIndicator* lockIndicator = lockIndicators.empty() ? nullptr : lockIndicators.front();
if (!lockIndicator) {
lockIndicator = new SystemLockIndicator(system, lock);
lockIndicator->setParent(system);
system->addLockIndicator(lockIndicator);
}
SystemLockIndicator* lockIndicator = new SystemLockIndicator(system, lock);
lockIndicator->setParent(system);
system->addLockIndicator(lockIndicator);

TLayout::layoutSystemLockIndicator(lockIndicator, lockIndicator->mutldata());
}
Expand Down

0 comments on commit 178a36d

Please sign in to comment.