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

Aligning of rests #189

Open
WindowsNT opened this issue Jan 6, 2025 · 4 comments
Open

Aligning of rests #189

WindowsNT opened this issue Jan 6, 2025 · 4 comments

Comments

@WindowsNT
Copy link

WindowsNT commented Jan 6, 2025

This is likely a fault of my Direct2D implementation but it is very strange.
Rests are displayed a bit below their position.

image

Others are positioned correctly (notes, clef, keys etc) so, do you suspect something very weird?

The same happens with bar numbers but there I can add <numDy = 2>.

Note that hit-testing is correct, the bounding rectangle is at the place where it should be.

@WindowsNT
Copy link
Author

Hit test:

image

@WindowsNT
Copy link
Author

WindowsNT commented Jan 6, 2025

It is caused by SetTextAlign

old code


	if (inAlign & kAlignCenter)
		{
			a2 = DWRITE_PARAGRAPH_ALIGNMENT_CENTER;
		}

Fix:

		if (inAlign & kAlignCenter && (inAlign & kAlignBase) == 0)
		{
			a2 = DWRITE_PARAGRAPH_ALIGNMENT_CENTER;
		}

Why the combination of kAlignCenter and kBaseLine doesn't want centered text?

@WindowsNT
Copy link
Author

Btw: kAlignCenter is for the X or the Y axis ? or both?

@dfober
Copy link
Member

dfober commented Jan 7, 2025

This part depends on the VGDevice implementation and I have no idea about Direct2D..

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