Skip to content

Commit

Permalink
Fix DrawStaffLines() for neume lines
Browse files Browse the repository at this point in the history
  • Loading branch information
yinanazhou committed Apr 23, 2024
1 parent 602c648 commit 65b4ccb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/staff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void Staff::AdjustDrawingStaffSize()
if (this->HasFacs()) {
Doc *doc = vrv_cast<Doc *>(this->GetFirstAncestor(DOC));
assert(doc);
if (doc->IsFacs()) {
if (doc->IsFacs() || doc->IsNeumeLines()) {
double rotate = this->GetDrawingRotate();
Zone *zone = this->GetZone();
assert(zone);
Expand Down
22 changes: 6 additions & 16 deletions src/view_page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1283,24 +1283,14 @@ void View::DrawStaffLines(DeviceContext *dc, Staff *staff, Measure *measure, Sys

int j, x1, x2, y1, y2;

if (staff->HasFacs() && m_doc->IsFacs()) {
double d = staff->GetDrawingRotate();
x1 = staff->GetDrawingX();
x2 = x1 + staff->GetWidth();
y1 = ToLogicalY(staff->GetDrawingY());
staff->AdjustDrawingStaffSize();
y2 = y1 - staff->GetWidth() * tan(d * M_PI / 180.0);
x1 = measure->GetDrawingX();
x2 = x1 + measure->GetWidth();
y1 = staff->GetDrawingY();
if (!staff->HasDrawingRotation()) {
y2 = y1;
}
else {
x1 = measure->GetDrawingX();
x2 = x1 + measure->GetWidth();
y1 = staff->GetDrawingY();
if (!staff->HasDrawingRotation()) {
y2 = y1;
}
else {
y2 = y1 - measure->GetWidth() * tan(staff->GetDrawingRotation() * M_PI / 180.0);
}
y2 = y1 - measure->GetWidth() * tan(staff->GetDrawingRotation() * M_PI / 180.0);
}

const int lineWidth = m_doc->GetDrawingStaffLineWidth(staff->m_drawingStaffSize);
Expand Down

0 comments on commit 65b4ccb

Please sign in to comment.