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

TextBlockExtensions GetCharacterRect always return rect(0,0,0,0) #25

Open
LSongBee opened this issue Mar 24, 2016 · 3 comments
Open

TextBlockExtensions GetCharacterRect always return rect(0,0,0,0) #25

LSongBee opened this issue Mar 24, 2016 · 3 comments

Comments

@LSongBee
Copy link

I try to use the TextBlockExtensions GetCharacterRect function to get text character's position and size but this function always return rect(0,0,0,0).
This issue is only at UWP platform, I try the same extension at win 8.1, it is OK.

@xyzzer
Copy link
Owner

xyzzer commented Mar 24, 2016

Seems to be working fine in the CascadingTextBlock control, I think. Could you provide repro steps?

@LSongBee
Copy link
Author

I'm not try CascadingTextBlock control I directly use TextBlockExtensions's GetCharacterRect at default TextBlock element. I just drag a TextBlock in xaml page, name it "tbTest", assing Text="Hello world". And call tbTest.GetCharacterRect(x) in .cs program to get every characters' rectangle. It return rect(0,0,0,0) at every char's position.
But, do the same thing at win 8.1. It can correctly return the chars' rectangle.

@xyzzer
Copy link
Owner

xyzzer commented Mar 25, 2016

I'll check it out when I get a chance. I remember that code wasn't really exact science. Maybe CascadingTextBlock doesn't actually need it or uses it in some very specific conditions.

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