On Wed, 25 Mar 2026 19:02:25 GMT, Marius Hanl <[email protected]> wrote:
>> Looking at the code review for the commit that caused this, that is a >> perfect example of how diffs can mislead. The fact that it introduced dead >> code was not visible from the diffs, only if you looked at the whole context. > > And I even made a (IMO good) suggestion to improve the if condition 🙂 > -> I made this comment because I felt like the if-else condition is > confusing. So turns out, it is. > > I would therefore recommend to improve it now and remove the else block. It > is empty anyway. I think it's out of scope for this PR, for several reasons. This code relies on current, undocumented behavior of the caret shape being either a single line or two lines encoded as `MoveTo`-`LineTo` pairs. There are plans to change the caret shape for certain BIDI/RTL scenarios to indicate the direction, so the old assumptions might not hold anymore. Also, in jfx25 we've added `LayoutInfo`/`CaretInfo` APIs in the `Text` and `TextFlow`, which should provide the caret information without relying on implementation details. related umbrellas: https://bugs.openjdk.org/browse/JDK-8343557 https://bugs.openjdk.org/browse/JDK-8300569 ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/2128#discussion_r2996129050
