Skip to content

Caret Position #1

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

Closed
oallouch opened this issue Nov 7, 2013 · 7 comments
Closed

Caret Position #1

oallouch opened this issue Nov 7, 2013 · 7 comments

Comments

@oallouch
Copy link

oallouch commented Nov 7, 2013

Hi,

First of all, nice control you got there !
I have an issue when a type the "tab" character. The caret doesn't move, but the text gets indented like it should be.

Olivier Allouch

@TomasMikula
Copy link
Member

Hi Olivier,

the tab issue is related to JavaFX issue #RT-32398. See also Known Issues.
Unfortunately, that issue is not reproducible using only public JavaFX API and probably won't get fixed until they themselves start using a caret within a TextFlow. Sadly, the advice for now is not to use tabs.

Tomas

@oallouch
Copy link
Author

oallouch commented Nov 7, 2013

I added a comment on the issue.
There's no way to work around this ?

@TomasMikula
Copy link
Member

I'm already working around that bug: to determine caret position within a TextFlow, I

  • create a copy of the incident Text node, unattached to a TextFlow,
  • determine caret position within that independent Text node (which works correctly in JavaFX),
  • add the x-offset of the incident Text node to the caret position.

Unfortunately, this doesn't work for tabs, because their width depends on the previous text, thus their width in the independent copy of Text is different than their width in the TextFlow.

@oallouch
Copy link
Author

oallouch commented Nov 7, 2013

Sorry to have doubted :)
I understand the problem. Not simple.
What's funny is that the text is positioned right.
Looks like JavaFX is really Swing 2.
You have to live in the source.

@oallouch
Copy link
Author

oallouch commented Nov 7, 2013

Did you see that Felipe Heidrich responded to my comment in the JavaFX JIRA ?
He has added a workaround source.

@TomasMikula TomasMikula reopened this Nov 11, 2013
@TomasMikula
Copy link
Member

I applied the suggested workaround.
Thanks for initiating this discussion and let me know if you find any other issues.

@oallouch
Copy link
Author

My pleasure

TomasMikula pushed a commit that referenced this issue Jun 10, 2016
Make SuperCodec package private again.
JordanMartinez pushed a commit that referenced this issue Jul 4, 2018
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