From c6f606de83841853276691709f498b74b5187700 Mon Sep 17 00:00:00 2001 From: Yinan Zhou Date: Fri, 2 Feb 2024 15:57:01 -0500 Subject: [PATCH] Adjust offset when insert new divLine --- src/editortoolkit_neume.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/editortoolkit_neume.cpp b/src/editortoolkit_neume.cpp index d6c97ef532d..ac01f9f0fde 100644 --- a/src/editortoolkit_neume.cpp +++ b/src/editortoolkit_neume.cpp @@ -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();