-
Notifications
You must be signed in to change notification settings - Fork 3k
Text positioning refinements #31017
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
Text positioning refinements #31017
Conversation
4d742f0 to
e3b3442
Compare
|
Nice! All good to me. |
src/engraving/dom/textbase.cpp
Outdated
| return false; | ||
| } | ||
|
|
||
| bool useBl = isMarker() || isJump() || isRehearsalMark() || isMeasureNumber() || isPlayCountText(); |
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.
What does Bl stand for? The naming is a bit obscure and in general this reads a bit wonky with all the negations, although there may not be clearer way to express the condition
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.
Barline - took me a second to work it out too! I've made this more clear
e3b3442 to
079ff34
Compare
src/engraving/dom/textbase.cpp
Outdated
| || parent()->isSpannerSegment(); | ||
|
|
||
| return !relativeToBarline && !harmonyRelativeToBarline && !textRelativeToBarline && !noPositionControl; | ||
| } |
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.
Reads a bit better now, but may I suggest rewriting this in some form like:
switch (type()) {
case ElementType::MARKER:
case ElementType::JUMP:
case ElementType::MEASURE_NUMBER:
case ElementType::PLAY_COUNT_TEXT:
return false;
case ElementType::HARMONY:
return !parent()->isFretDiagram();
case ElementType::SOMETHING_ELSE:
return somethingElse;
default:
return basicConditions;
}
Cause it still reads weird to be definining a "relative to noteheade" property as "not relative to barline". Besides, those are a lot of boolean checks, a switch should be a bit more efficient (though I'm sure it hardly matters here).
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.
In fact, a purist would say that this should be a virtual method and specific TextBase classes should implement their own versions. Either way is fine for me, I'll leave it up to you :)
Change tooltips in inspector Refine align and position buttons in edit style Fix button spacing Add vtest Migrate old scores Refactor `positionRelativeToNoteheadRest`
6f16cce to
b13bd58
Compare


Refinements to inspector controls and text style dialog controls.

Also, aligns the left/center/right of the text box to the left/center/right of the note it's being aligned to.
Screen.Recording.2025-11-13.at.15.37.54.mov