Skip to content

Commit 205b310

Browse files
committed
Don't scan annotations on hidden staves
1 parent 2b24559 commit 205b310

4 files changed

Lines changed: 3 additions & 21 deletions

File tree

src/engraving/dom/engravingitem.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -364,12 +364,6 @@ bool EngravingItem::collectForDrawing() const
364364
return false;
365365
}
366366

367-
bool isAnnotation = parent() && parent()->isSegment() && toSegment(parent())->element(track()) != this;
368-
if (isAnnotation) {
369-
Segment* segment = toSegment(parent());
370-
return systemFlag() || (segment->measure() && segment->measure()->visible(staffIdx()));
371-
}
372-
373367
return true;
374368
}
375369

src/engraving/dom/harmony.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -679,19 +679,6 @@ NoteCaseType Harmony::bassRenderCase() const
679679
return noteCase;
680680
}
681681

682-
bool Harmony::collectForDrawing() const
683-
{
684-
if (!visible() && !score()->isShowInvisible()) {
685-
return false;
686-
}
687-
688-
if (Segment* parentSeg = getParentSeg()) {
689-
return systemFlag() || (parentSeg->measure() && parentSeg->measure()->visible(staffIdx()));
690-
}
691-
692-
return true;
693-
}
694-
695682
//---------------------------------------------------------
696683
// startEdit
697684
//---------------------------------------------------------

src/engraving/dom/harmony.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,6 @@ class Harmony final : public TextBase
314314
void setFamily(const String& val) override { m_fontFamily = val; }
315315
void setSize(const double& val) override { m_fontSize = val; }
316316

317-
bool collectForDrawing() const override;
318-
319317
struct LayoutData : public TextBase::LayoutData {
320318
ld_field<double> harmonyHeight = { "[Harmony] harmonyHeight", 0.0 }; // used for calculating the height is frame while editing.
321319
ld_field<std::vector<LineF> > polychordDividerLines = { "[Harmony] polychordDividerLine", std::vector<LineF>() };

src/engraving/dom/segment.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,6 +1489,9 @@ void Segment::scanElements(std::function<void(EngravingItem*)> func)
14891489
e->scanElements(func);
14901490
}
14911491
for (EngravingItem* e : annotations()) {
1492+
if (!e->systemFlag() && (!measure() || !measure()->visible(e->staffIdx()))) {
1493+
continue;
1494+
}
14921495
e->scanElements(func);
14931496
}
14941497
}

0 commit comments

Comments
 (0)