Skip to content

getCharacterBoundsOnScreen(int from, int to) failed to get the bounds on screen #1272

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

Open
mindolph opened this issue Apr 15, 2025 · 3 comments

Comments

@mindolph
Copy link

Since v0.11.5, the method getCharacterBoundsOnScreen(int from, int to) failed to get the bounds on screen.
eg:

invoking getCharacterBoundsOnScreen(0, 0) throws exception:

java.lang.IllegalArgumentException: This ParagraphText is not the parent of the given shape (CaretNode(name= position=0 paragraphIndex=0 columnPosition=0 Path[elements=[MoveTo[x=0.0, y=0.0], LineTo[x=0.0, y=0.0]], fill=null, fillRule=NON_ZERO, stroke=0x000000ff, strokeWidth=1.0])):
Expected: ParagraphText@1196785562(paragraph=Par[[]; StyledSegment(segment=# Markdown style=[heading])])
Actual:   null
@Jugen
Copy link
Collaborator

Jugen commented Apr 15, 2025

Thank you for reporting.
Unfortunately, I cannot reproduce the exception so could you please provide a simple program that does.
Thanks again.

@mindolph
Copy link
Author

Just use a long text and let the vertical scrollbar shows, scroll down to hide the first paragraph, then call getCharacterBoundsOnScreen(0, 0) to get bounds in some way, the exception I mentioned will out.

@Jugen
Copy link
Collaborator

Jugen commented Apr 25, 2025

Strange, I still can't replicate it ?

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