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 grip size (replicate MU3 behaviour) and make it easier to select grips #9414

Merged
merged 2 commits into from
Oct 11, 2021

Conversation

cbjeukendrup
Copy link
Contributor

Resolves: #9257

Despite my comment there, I replicated the MU3 behaviour (which was in fact already done, but guiScaling was not taken into account).

Also, below a grip, there might be elements that do not belong to that grip. When clicking the grip at the location of such an element, that element would get selected rather than the grip. That was frustrating and made it difficult to grab the grip.
I changed that: now, when you click anywhere inside a grip's rectangle, you will be selecting the grip, instead of the unrelated element below it.
(When you still want to select the element below it, just click outside the grip, or click somewhere on the canvas to unselect the element to which the grip belongs, so that the grip disappears.)

@Eism Eism merged commit 927898a into musescore:master Oct 11, 2021
@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Oct 11, 2021

I take that something liks eht 1sdt commit might be needed for 3.x as well?
I've found 2 places in the 3.x code that might need this:

void ScoreView::updateGrips()
{
if (!editData.element)
return;
double dx = 1.5 / _matrix.m11();
double dy = 1.5 / _matrix.m22();
for (const QRectF& r : editData.grip)
score()->addRefresh(r.adjusted(-dx, -dy, dx, dy));
qreal w = 8.0 / _matrix.m11();
qreal h = 8.0 / _matrix.m22();
QRectF r(-w*.5, -h*.5, w, h);
editData.grip.resize(editData.grips);

and
void ScoreView::endFotoDrag()
{
qreal w = 8.0 / _matrix.m11();
qreal h = 8.0 / _matrix.m22();
QRectF r(-w*.5, -h*.5, w, h);
editData.grip.resize(8);

In either case width and height muliplied by guiScaling?

Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Oct 11, 2021
@cbjeukendrup
Copy link
Contributor Author

@Jojo-Schmitz I don't think it's necessary in MU3, in the first place because it just works as is (don't fix it if it ain't broken 😉).

In the second place, I think that the guiScaling is somehow handled by the scaling of the painter in MU3. In MU4, there is a lot of multiplying and dividing with that guiScaling, and I suspect that this shouldn't be necessary. I will research that in the future.

Anyway, I see that you added it already to your 3.7 PR, so I will try how it works out in the artifact.

@cbjeukendrup cbjeukendrup deleted the fix_grip_size branch October 11, 2021 09:46
@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Oct 11, 2021

Yes, please try and tell me. I don't have a HighDPI screen to test this on
If it isn't needed there, it is easily removed again ;-)

@cbjeukendrup
Copy link
Contributor Author

I think it should be removed from the MU3 PR. The result is that the grips are too big when they appear, and when zooming using the trackpad, they jump back to the correct size.

@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Oct 11, 2021

OK, will do

Edit: done. Thanks for checking. Seems I missunderstood the title, "(replicate MU3 behaviour)" to mean that the same issue exists there too

@DmitryArefiev
Copy link
Contributor

DmitryArefiev commented Oct 15, 2021

Checked #9257 on Mac11 - FIXED

In Dorico, the grips follow the zoom level, which looks and works a lot better in my opinion. We could also do that, and >maybe set a minimum and maximum size, so that they don't get too small at smaller zoom levels or too big at higher zoom >levels.

Noticed that too.. Will log it as a separate issue

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.

[MU4 Issue] Grip handles are too small in MacOS
4 participants