Center horizontally on notehead
I'm working on a very basic musica ficta plugin. I'm still learning the API, but my efforts so far are attached. It does not parse more than one accidental yet and does not have any error detection.
I need help figuring out how to get a precise Xoffset to center the accidental horizontally every time. I posted on the support forum (https://musescore.org/en/node/328913) looking for a way to center an accidental, but I think it's more appropriate here. What's the best way to calculate the width of a notehead and then convert that to staff spaces? I also need to account for the original spacing between the notehead and the accidental. Would I use the horizontal dimensions of the bbox?
Thanks for any help!