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

fix #282246: "other" appearance in time signature properties does not work #5315

Merged
merged 1 commit into from
Mar 29, 2020

Conversation

tcannon686
Copy link

This commit fixes #282246. This fix works by changing the implementation closer to that of MuseScore 2. The issue is that "other" time signatures are created by changing the numerator string to the symbol, and the denominator string to empty, but during formatting, if the denominator is empty, it is replaced with the actual number of the time signature. The fix only replaces the denominator if the numerator and the denominator are empty. This way, the denominator will stay empty, and the formatting will be correct. This is how it was done in previous versions of MuseScore.

This bug occurs when the user chooses an "other" time signature
property. This fix works by changing the implementation to be closer to
MuseScore 2. This works by simply only checking to use the numbers if
the numerator string is empty. This way, if the denominator string is
empty, the numerator string which will have the custom symbol, will line
up in the middle. This was how the implementation worked in MuseScore 2.
@Harmoniker1
Copy link
Contributor

It's better to create another branch and commit changes on it, so that later if you want to merge musescore/master to your fork's master, it won't cause any conflict.

@tcannon686
Copy link
Author

It's better to create another branch and commit changes on it, so that later if you want to merge musescore/master to your fork's master, it won't cause any conflict.

@Howard-C my mistake, I am still a bit new to git. I will do this in the future. Thanks!

@Harmoniker1
Copy link
Contributor

It's better to create another branch and commit changes on it, so that later if you want to merge musescore/master to your fork's master, it won't cause any conflict.

@Howard-C my mistake, I am still a bit new to git. I will do this in the future. Thanks!

No problem. You can "drop" your own commit after this PR gets merged because the next time you sync your fork that commit will come back without any possible conflict.

ns = toTimeSigString(_numeratorString.isEmpty() ? QString::number(_sig.numerator()) : _numeratorString);
ds = toTimeSigString(_denominatorString.isEmpty() ? QString::number(_sig.denominator()) : _denominatorString);
if (_numeratorString.isEmpty()) {
ns = toTimeSigString(_numeratorString.isEmpty() ? QString::number(_sig.numerator()) : _numeratorString);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If _numeratorString is empty in the previous line, it is empty here too and this line could be simplified to:
ns = toTimeSigString( QString::number(_sig.numerator()) );

@mgavioli
Copy link
Contributor

According to my tests, this PR also fixes issue #286478 (Create time signature only with nominator not possible).

@mgavioli
Copy link
Contributor

As far as I can test, this PR works correctly and does solve both #282246 and #286478 issues.

@Harmoniker1
Copy link
Contributor

#286478 is a duplicate of #281071. PR #5370 has a complete fix for that, this PR hasn't because if the numeratorString is empty and the denominatorString is not, the time signature will still display wrongly.

@mgavioli
Copy link
Contributor

mgavioli commented Jan 4, 2020

Any reason for not merging this PR? Ver. 3.4 Beta still does not support numerator-only time signatures or mensural "time signatures", which were correctly supported by ver. 2.x

ds = toTimeSigString(_denominatorString.isEmpty() ? QString::number(_sig.denominator()) : _denominatorString);
if (_numeratorString.isEmpty()) {
ns = toTimeSigString(_numeratorString.isEmpty() ? QString::number(_sig.numerator()) : _numeratorString);
ds = toTimeSigString(_denominatorString.isEmpty() ? QString::number(_sig.denominator()) : _denominatorString);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this broke exist existing scores that had no text specified at all. Those should simply use the default numerator & denominator values, but here the denominator is left empty.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or, perhaps more commonly (not sure), it seems some scores have the numerator set but not denominator even though the user did not specifically intend that. This is the case for me, anyhow.

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.

6 participants