From 961c1bb80acdb9bbb20ed066b5a69fe65e94ffe5 Mon Sep 17 00:00:00 2001 From: Yinan Zhou Date: Thu, 18 Jan 2024 16:00:55 -0500 Subject: [PATCH] Add neume elements & drawingFacsY to SyncFromFacsimileFunctor & SyncToFacsimileFunctor --- include/vrv/layerelement.h | 2 ++ src/facsimilefunctor.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/vrv/layerelement.h b/include/vrv/layerelement.h index 085fa811845..34f9b57e2df 100644 --- a/include/vrv/layerelement.h +++ b/include/vrv/layerelement.h @@ -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 diff --git a/src/facsimilefunctor.cpp b/src/facsimilefunctor.cpp index 83f53d6b275..c3c5bef5db4 100644 --- a/src/facsimilefunctor.cpp +++ b/src/facsimilefunctor.cpp @@ -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; } @@ -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; }