Skip to content

Commit

Permalink
fix: insertion offset in neon
Browse files Browse the repository at this point in the history
- Set rotate to 0 if not has rotate
- Add clef offset when using default clef

refs: DDMAL/Neon#1254, DDMAL/Neon#1226
  • Loading branch information
yinanazhou committed Jan 14, 2025
1 parent a45aec6 commit ce2f879
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/editortoolkit_neume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4215,6 +4215,7 @@ bool EditorToolkitNeume::AdjustPitchFromPosition(Object *obj)
return false;
}
clef = layer->GetCurrentClef();
clefOffset = round((double)(staff->m_drawingLines - clef->GetLine()) * staffSize);
}
else {
Staff *clefStaff = dynamic_cast<Staff *>(clef->GetFirstAncestor(STAFF));
Expand Down
6 changes: 5 additions & 1 deletion src/facsimilefunctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ FunctorCode SyncFromFacsimileFunctor::VisitStaff(Staff *staff)
m_staffZones[staff] = zone;

// The staff slope is going up. The y left position needs to be adjusted accordingly
if (zone->HasRotate() && zone->GetRotate() < 0) {
if (!zone->HasRotate()) {
zone->SetRotate(0);
}
else {
staff->m_drawingFacsY = staff->m_drawingFacsY
+ (m_currentNeumeLine->m_drawingFacsX2 - m_currentNeumeLine->m_drawingFacsX1)
* tan(zone->GetRotate() * M_PI / 180.0);
Expand Down Expand Up @@ -326,6 +329,7 @@ FunctorCode SyncToFacsimileFunctor::VisitSb(Sb *sb)

FunctorCode SyncToFacsimileFunctor::VisitStaff(Staff *staff)
{
LogError("SyncToFacsimileFunctor::VisitStaff");
Zone *zone = this->GetZone(staff, staff->GetClassName());
zone->SetUly(m_view.ToDeviceContextY(staff->GetDrawingY()) / DEFINITION_FACTOR + m_pageMarginTop);

Expand Down

0 comments on commit ce2f879

Please sign in to comment.