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 #292900: Plugin: Expose Element.pos X/Y values to plugins. #5254
Conversation
79d7429
to
a88063f
Compare
mscore/plugin/api/elements.h
Outdated
@@ -88,6 +88,20 @@ class Element : public Ms::PluginAPI::ScoreElement { | |||
* \since 3.3 | |||
*/ | |||
Q_PROPERTY(Ms::PluginAPI::Element* parent READ parent) | |||
/** | |||
* Computed X-axis layout position from a reference position. |
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.
Could it perhaps be better to say that this is actual position rather than computed to denote that it includes also offset
and all other possible modifiers as its part? Or, as another option, perhaps we could explicitly mention the fact that this already includes any offset applied.
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've updated the api description.
-Dale
Expose Element.pos X/Y values so that plugin's can accurately position things like STAFF_TEXT on the score. One example is to position a tin whistle finger hole pattern directly under a grace note. Another is to place note names properly using MuseScore's shipped notename.qml plugin.
Modify plugin to take advantage of exposure of element.posX/Y which allows for precise positioning of elements like STAFF_TEXT.
a88063f
to
26ab4f5
Compare
for (var i = 0; i < notes.length; i++) { | ||
var sep = ","; // change to "\n" if you want them vertically | ||
var sep = "\n"; // change to "," if you want them horizontally (anybody?) |
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.
@Jojo-Schmitz, that seems to be your code originally, do you agree with changing this default?
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.
Please check out my examples at the issue web page to see why I made that switch.
-Dale
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.
@dmitrio95 I'm fine with that, and it isn't really my code alone anyway
83dde0f
to
26ab4f5
Compare
Expose Element.pos X/Y values so that plugin's can accurately
position things like STAFF_TEXT on the score. One example is
to position a tin whistle finger hole pattern directly under
a grace note. Another is to place note names properly using
MuseScore's shipped notename.qml plugin.