Skip to content

Commit

Permalink
Adjust offset when insert new divLine
Browse files Browse the repository at this point in the history
  • Loading branch information
yinanazhou committed Feb 2, 2024
1 parent 603514a commit c6f606d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/editortoolkit_neume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1230,13 +1230,14 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in
= (int)(m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / NOTE_HEIGHT_TO_STAFF_SIZE_RATIO);
const int noteWidth
= (int)(m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / NOTE_WIDTH_TO_STAFF_SIZE_RATIO);
const int offsetX = (int)(noteWidth / 2);

ulx -= noteWidth / 2;
uly -= noteHeight / 2;

zone->SetUlx(ulx);
zone->SetUlx(ulx + offsetX);
zone->SetUly(uly);
zone->SetLrx(ulx + noteWidth);
zone->SetLrx(ulx + noteWidth + offsetX);
zone->SetLry(uly + noteHeight);
layer->ReorderByXPos();

Expand Down

0 comments on commit c6f606d

Please sign in to comment.