Skip to content
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

[MU3] Fix #322347 - ensure hidden rests in V2-4 don't move back to default position #8424

Merged
merged 1 commit into from Jun 28, 2021

Conversation

wizofaus
Copy link
Contributor

Resolves: https://musescore.org/en/node/322347

Hiding V2-4 rests currently causes them to move back to the default/vertical center position on a stave, causing them to interfere with visible V1 elements. In general hiding items shouldn't cause the hidden item to move.

NB this is only a partial fix - the other improvement would be to ensure that hidden elements are drawn first (in a layer underneath everything else) so that visible ones can't be obscured by them.

  • [ x ] I signed CLA
  • [ x ] I made sure the code in the PR follows the coding rules
  • [ x ] I made sure the code compiles on my machine
  • [ x ] I made sure there are no unnecessary changes in the code
  • [ x ] I made sure the title of the PR reflects the core meaning of the issue you are solving
  • [ x ] I made sure the commit message(s) contain a description and answer the question "Why do those changes fix that particular issue?" or "Why are those changes really necessary as improvements?"
  • [ x ] I made sure the commit message title starts with "fix #424242:" if there is a related issue
  • I created the test (mtest, vtest, script test) to verify the changes I made

@wizofaus
Copy link
Contributor Author

wizofaus commented Jun 23, 2021

Fixing the z-order so that invisible elements are painted first, under visible elements, is easy with a simple change to Element::z() to always return 0 for invisible elements, or a relatively small change to paintElements( ) so that !visible() overrides z() when sorting.
Not sure which is best, though if we want invisible notes/rests drawn over staff lines, then it's probably better just to return a z() position of SYSTEM_DIVIDER * 100 (1400):

        if (!visible()) {
            return std::min(int(ElementType::SYSTEM_DIVIDER) * 100, int(type()) * 100);
        } else {
            return int(type()) * 100;
        }

(this ensures invisible rests are still drawn over invisible staff lines).

@igorkorsukov igorkorsukov merged commit 52f57a8 into musescore:master Jun 28, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jun 29, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 1, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 5, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 6, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 13, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 27, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 27, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 27, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 27, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 27, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 27, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 28, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Jul 28, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 13, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 13, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 19, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 19, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 30, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 1, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 2, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 10, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 23, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants