Extend brackets on other staves is not saved

• Jun 12, 2018 - 08:48
Reported version
3.0
Type
Functional
Severity
S3 - Major
Status
closed
Project

GIT commit : 9a9256c / Windows10

1) Untitled "default" score
2) Add an instrument (eg violin)
3) Add a bracket
4) Extend this bracket over the two staves
5) Save as -> Name the file -> Save

Result: the bracket extension is lost.
bracket.jpg


Comments

The bracket's span property is calculated by Bracket::endEditDrag(). This function is called twice: first when the drag is completed, and again upon exit from edit mode. The span is calculated correctly the first time, and incorrectly the second time. I am not sure why endEditDrag() is being called from within Bracket::endEdit(), but removing that call seems to solve the problem.

The problem is that by the time endEditDrag() is called from Bracket::endEdit(), the bracket and its parent system have already been destroyed and recreated during score layout. Because of this, pagePos() returns (0,0), which gives ay1 a value of 0. This can be solved by making ay1 a member variable of the Bracket class, and setting its value in Bracket::startEdit().