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 #292900: Plugin: Expose Element.pos X/Y values to plugins. #5254

Merged
merged 2 commits into from Aug 4, 2019

Conversation

@DLLarson
Copy link
Contributor

commented Aug 2, 2019

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.

@DLLarson DLLarson changed the title Fix #292900: Expose Element.pos X/Y values to plugins. Fix #292900: Plugin: Expose Element.pos X/Y values to plugins. Aug 2, 2019

@DLLarson DLLarson force-pushed the DLLarson:expose-element-pos branch from 79d7429 to a88063f Aug 3, 2019

@@ -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.

This comment has been minimized.

Copy link
@dmitrio95

dmitrio95 Aug 3, 2019

Contributor

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.

This comment has been minimized.

Copy link
@DLLarson

DLLarson Aug 3, 2019

Author Contributor

I've updated the api description.
-Dale

DLLarson added some commits Aug 2, 2019

Fix #292900: Expose Element.pos X/Y values to plugins.
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.
Fix #292900: Modify plugin notenames.qml for element.posXY support
Modify plugin to take advantage of exposure of element.posX/Y which
allows for precise positioning of elements like STAFF_TEXT.

@DLLarson DLLarson force-pushed the DLLarson:expose-element-pos branch from a88063f to 26ab4f5 Aug 3, 2019

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?)

This comment has been minimized.

Copy link
@dmitrio95

dmitrio95 Aug 3, 2019

Contributor

@Jojo-Schmitz, that seems to be your code originally, do you agree with changing this default?

This comment has been minimized.

Copy link
@DLLarson

DLLarson Aug 3, 2019

Author Contributor

Please check out my examples at the issue web page to see why I made that switch.

-Dale

This comment has been minimized.

Copy link
@Jojo-Schmitz

Jojo-Schmitz Aug 4, 2019

Contributor

@dmitrio95 I'm fine with that, and it isn't really my code alone anyway

@DLLarson DLLarson force-pushed the DLLarson:expose-element-pos branch from 83dde0f to 26ab4f5 Aug 4, 2019

@dmitrio95 dmitrio95 merged commit 5979345 into musescore:master Aug 4, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@DLLarson DLLarson deleted the DLLarson:expose-element-pos branch Aug 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.