Open heyaphra opened 1 week ago
Update: I was able to "fix" this problem by changing the staffLineCenterY
in built_staff.dart
:
final measureOnCanvas = measure.placeOnCanvas(
staffLineCenterY + staffLineCenterY / 2),
currentX,
);
Not sure if this would break any other intended use cases.
Thank you for the Issue and kind example. We will address this issue as soon as possible. Incidentally, how about using the uppermost part as the origin of the Y-coordinate? (in this case, the topmost part of the G clef)
I'm concerned that if the uppermost part were used as the origin then the staff would be off-center inside of its container. Are there any benefits conferred by that approach that I'm not seeing?
Here's a picture to go along with the code example that I modified:
I was a little mistaken. I thought it would cause problems with rendering multi-stage Stave, but your method will work. I will put out a revised version in a few more days.
Summary
While the widget is behaving as expected (the bottom staff line renders at (0, 0) in the coordinate system), this causes issues when centering the widget within a container. Rendering dead-center would be useful for displaying figures for music theory education.
Example of the issue:
Example code: