Skip to content

Commit

Permalink
Revert "Don't delete and recreate SystemLockIndicator if not necessary"
Browse files Browse the repository at this point in the history
This reverts commit 3f3761c.
  • Loading branch information
mike-spa committed Mar 10, 2025
1 parent 3a48e31 commit 71b7b7c
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 71b7b7c

Please sign in to comment.