-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Give the canvas some margin when first opening a score #24483
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually we might want to center the score page; this was implemented for 3.6.1 or 3.6.2, but we never ported it to MS4. But for now this is a nice improvement!
@@ -171,6 +171,17 @@ void NotationViewInputController::initZoom() | |||
currentNotation()->viewState()->setMatrixInited(true); | |||
} | |||
|
|||
void NotationViewInputController::initCanvasPos() | |||
{ | |||
double canvasMargin = 10 * DPMM; // 1 centimetre |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume it's intentional that this cm is relative to the score size, and not always corresponds to 1 cm on the screen (for example when the default zoom percentage is not 100%).
Maybe it's a bit much though. I would personally prefer something closer to MScore::horizontalPageGapOdd
.
If I'm remember correctly (I could be confusing it with something else), the centering was a somewhat controversial choice. The downside is, it makes the score farther from the palette by default on a large monitor, making drag & drop significantly more work. On the other hand, clearly a nice for many purposes. So while I'm not a huge fan of having more and more preferences, the centering seems like a good possibility. Especially if it were tied to the workspace the way UI preferences are supposed to be but aren't - see #15957. Then a "presentation" workspace and an "editing" workspace could use different settings of that preference to good effect. |
5477136
to
2bd9198
Compare
@cbjeukendrup could you pls take a second look at this after the changes and review/merge :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
2bd9198
to
2f620fb
Compare
Looks like 'zoom to page width' etc. is not completely right yet (there's too much margin). Perhaps it has to do with whether Schermopname.2024-09-16.om.12.50.06.mov |
bool centerHorizontally = totalScoreWidth < viewWidth; | ||
bool centerVertically = totalScoreHeight < viewHeight; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2f620fb
to
5ade545
Compare
@cbjeukendrup hopefully should be ok now |
f4e6db7
to
e8ad30b
Compare
Resolves: #23404
[EDIT]
After consulting with @Tantacrul, I have slightly changed my initial implementation such that:
if there is enough space given the default zoom level and the canvas size, we center it on the canvas
ff there isn't, we align it with a padding to the margin that I've set equal to the gap between pages.