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 #315779: Disable auto-size of vertical frame when dragging the height handle #7362

Merged
merged 1 commit into from
Feb 4, 2021

Conversation

cbjeukendrup
Copy link
Contributor

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

  • I signed CLA
  • I made sure the code in the PR follows the coding rules
  • I made sure the code compiles on my machine
  • I made sure there are no unnecessary changes in the code
  • I made sure the title of the PR reflects the core meaning of the issue you are solving
  • 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?"
  • 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

@Jojo-Schmitz
Copy link
Contributor

There a few mtests that fail, seems those insist on 10 being the height of vertical frames. I don't quite get why and how thios is related to disabling the Autimatic site on dragging that size handle?

@@ -790,11 +790,24 @@ void VBox::layout()
contentHeight = minHeight();

setHeight(contentHeight);
setBoxHeight(Spatium(contentHeight / spatium()));
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this here the cause for the mtest fails?

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems likely, as those now all get that default size set explicitly due to auto-size instead of keeping the old size value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I have found a way of doing it without this line. I will try that soon.

@cbjeukendrup cbjeukendrup force-pushed the mu3/vbox-auto-size-drag branch from f6e599c to 91311a0 Compare January 29, 2021 11:37
@MarcSabatella
Copy link
Contributor

That certainly looks a lot safer now. Just thinking it through - what is the expected behavior if you turn autosize off for a box that has been expanded already buy this - should the box snap to the height given in the Inspector? And then let's say you add more content to the box, and now it's not big enough - should turning it on automatically snap the box to the required size? Currently, both happen, and I think that's probably as expected. It looks to me like this change won;t affect that, which is good, but also works as I expect with respect to dragging, where starting a drag on an autosize-expanded box disables autosize but does not cause the box instantly shrink. In that sense it's very much like how Alt+drag of an autoplaced element disables autoplace but doesn't cause the position to suddenly reset.

So on paper all is good as far as I am concerned.

Once thing that has bugged me about the autosize design all along is that magic number 10 sp that basically serves as a minimum box height with autosize enabled. I'd have preferred this to have been a style setting, assuming we could work out the compatibility implications. FWIW, it's technically possible to implement that without much of a UI change, just add the style setting and mark the height property as styled in the boxStyle definition in box.cpp. This should automatically result in a "set as style" button being added to the Inspector. But, I'm not really recommending that right now - something to think about though.

libmscore/box.h Outdated Show resolved Hide resolved
@cbjeukendrup cbjeukendrup force-pushed the mu3/vbox-auto-size-drag branch from 91311a0 to b52c6ae Compare February 3, 2021 17:36
@vpereverzev vpereverzev merged commit 996eb7d into musescore:3.x Feb 4, 2021
@cbjeukendrup cbjeukendrup deleted the mu3/vbox-auto-size-drag branch February 4, 2021 10:34
@igorkorsukov
Copy link
Contributor

@cbjeukendrup Could you please port the changes to the master

@cbjeukendrup
Copy link
Contributor Author

@igorkorsukov Yep, coming soon!

RomanPudashkin added a commit that referenced this pull request Feb 15, 2021
[MU4] Ported #7362: Fix #315779: Disable auto-size of vertical frame when dragging the height handle
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