-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #269870 SVG bugfix & unify page print function #3512
Conversation
ok, as I said above, I am aware of a bug. What I might do...I think I tried to do way too much in this... I think I should focus first on getting the SVG output correct. And then I could make another subsequent PR which tried to unify the all page print outputs. |
Previously there was a bug with SVG output optimization which attempted to draw one set of staff lines for each system if there was no invisible staff lines or HBoxes, in which case it falled back to drawing staff lines measure-by-measure. However, that optimization had a mistake, whereby only the first measure of staff lines was drawn for each system. Also there would be segfaults in the middle of SVG output with MMRests. This commit fixes that error and segfault. It also improves the optimization by combining staff lines whenever there are contingous measures, even if only for part of a system. It also unifies the page print function for all output modes (SVG, PDF, thumbnail, etc). This helps out with keeping consistent behavior in the output, and also allows for PDF files to benefit from the optimization by having fewer elements.
3ce7cda
to
69091f2
Compare
I fixed the MM rest bug (which also happened to affect master). I've updated the commit message: "Previously there was a bug with SVG output optimization which attempted to draw one set of staff lines for each system if there was no invisible staff lines or HBoxes, in which case it falled back to drawing staff lines measure-by-measure. However, that optimization had a mistake, whereby only the first measure of staff lines was drawn for each system. Also there would be segfaults in the middle of SVG output with MMRests. This commit fixes that error and segfault. It also improves the optimization by combining staff lines whenever there are contingous measures, even if only for part of a system. It also unifies the page print function for all output modes (SVG, PDF, thumbnail, etc). This helps out with keeping consistent behavior in the output, and also allows for PDF files to benefit from the optimization by having fewer elements." I still should test more, but atleast my test file works also with MM rests enabled now. |
I should say, the PR looks like more changes than it really is. I could produce a smaller PR which only did the bug fix, without unifying, and that might help out for reviewing. |
just a note to myself, travis failed because: /home/travis/build/musescore/MuseScore/mtest/testutils.cpp: In member function ‘bool Ms::MTest::savePdf(Ms::MasterScore*, const QString&)’: which is because I changed the functions around. I'll fix that in a couple days. |
Something is wrong about the commit message and PR title: there is no issue #822684. I guess you mean issue #269870, don't you? |
You're right. I mistakenly looked at the number of a comment. |
Can't this one get closed now, after #3853 ? |
SVG has been fixed in c859eae. |
printing a page follows same code strucutre regardless of SVG, PDF,thumbnail, etc. This unifies the code between these print modes a
bit, and that helps out with keeping consistent behavior in the output.
Previously there was a bug with SVG output because it was trying to use
an optimization whereby staff lines were extended if all systems in a
measure were visible and weren't broken by frames. However, that
optimization had a mistake, whereby only the first measure of staff
lines was drawn. By unifying the print function, then also PDF can
benefit from the optimization. I've also improved the optimizatino a
bit to also handle all continuous measures even if the entire staff is
unbroken. I still need to investigate a bug with MMRests, though.