Skip to content

Commit

Permalink
Add neume elements & drawingFacsY to SyncFromFacsimileFunctor & SyncT…
Browse files Browse the repository at this point in the history
…oFacsimileFunctor
  • Loading branch information
yinanazhou committed Jan 18, 2024
1 parent 889e4f7 commit 961c1bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions include/vrv/layerelement.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ class LayerElement : public Object,
public:
/** Absolute position X. This is used for facsimile (transcription) encoding */
int m_drawingFacsX;
/** Absolute position Y. This is used for facsimile (transcription) encoding */
int m_drawingFacsY;
/**
* This stores a pointer to the cross-staff (if any) and the appropriate layer
* See PrepareCrossStaffFunctor
Expand Down
6 changes: 4 additions & 2 deletions src/facsimilefunctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ SyncFromFacsimileFunctor::SyncFromFacsimileFunctor(Doc *doc) : Functor()

FunctorCode SyncFromFacsimileFunctor::VisitLayerElement(LayerElement *layerElement)
{
if (!layerElement->Is({ CLEF, CUSTOS, NC, NOTE, REST, SYL })) return FUNCTOR_CONTINUE;
if (!layerElement->Is({ ACCID, CLEF, CUSTOS, DIVLINE, LIQUESCENT, NC, NOTE, REST, SYL })) return FUNCTOR_CONTINUE;

Zone *zone = layerElement->GetZone();
assert(zone);
layerElement->m_drawingFacsX = m_view.ToLogicalX(zone->GetUlx() * DEFINITION_FACTOR);
layerElement->m_drawingFacsY = m_view.ToLogicalY(zone->GetUly() * DEFINITION_FACTOR);

return FUNCTOR_CONTINUE;
}
Expand Down Expand Up @@ -187,10 +188,11 @@ SyncToFacsimileFunctor::SyncToFacsimileFunctor(Doc *doc) : Functor()

FunctorCode SyncToFacsimileFunctor::VisitLayerElement(LayerElement *layerElement)
{
if (!layerElement->Is({ NOTE, REST })) return FUNCTOR_CONTINUE;
if (!layerElement->Is({ ACCID, CLEF, CUSTOS, DIVLINE, LIQUESCENT, NC, NOTE, REST, SYL })) return FUNCTOR_CONTINUE;

Zone *zone = this->GetZone(layerElement, layerElement->GetClassName());
zone->SetUlx(m_view.ToDeviceContextX(layerElement->GetDrawingX()) / DEFINITION_FACTOR + m_pageMarginLeft);
zone->SetUly(m_view.ToDeviceContextY(layerElement->GetDrawingY()) / DEFINITION_FACTOR + m_pageMarginTop);

return FUNCTOR_CONTINUE;
}
Expand Down

0 comments on commit 961c1bb

Please sign in to comment.