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

More hit-test notifications #186

Open
WindowsNT opened this issue Dec 30, 2024 · 3 comments
Open

More hit-test notifications #186

WindowsNT opened this issue Dec 30, 2024 · 3 comments

Comments

@WindowsNT
Copy link

GuidoGetMap returns rects for many elements.

It would be nice if:

  • Key placement was returned
  • Dynamics placement was returned
  • Text placement was returned
  • Lyrics placement was returned
  • Articulation placement was returned

Best.

@dfober
Copy link
Member

dfober commented Jan 1, 2025

I'm afraid I won't have time to extend the mapping for a while.
If you'd like to try your hand at it, I can show you how. It's not necessarily difficult, but it does take a bit of time.
The mapping is based on the elements bounding boxes and one of the problems that can occur is that the bounding boxes are not exact (when the elements are adjusted manually e.g. dx, dy, size...). That's what can take time.

@WindowsNT
Copy link
Author

Yes, tell me how.
Happy new Year also.

@dfober
Copy link
Member

dfober commented Jan 2, 2025

Happy new year too !

Here are some indications:
all graphic objects (GR) have a mMapping field, computed from the bounding box (mBoundingBox) that stores mapping information (which may be slightly different from the bounding box)
see GObject.h

to extend the mapping:

  • extend GuidoElementSelector and GuidoElementType with you target types (GuidoScoreMap.h)
  • make sure that the mMapping field is set by the target object type
    mMapping is computed by GR objects, generally by the updateBoundingBox method, but for a set of objects it is set by the setHPosition method (objects that don't implement updateBoundingBox)
  • the target object must override the GetMap method (defined in GObject)

That's basically the way the extend the mapping (not sure that I didn't forget a point)
Keep me informed and I'll be happy with a PR at the end.

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

No branches or pull requests

2 participants