RFR: 8319844 : Text/TextFlow.hitTest() is incorrect in RTL orientation
Andy Goryachev
angorya at openjdk.org
Wed Jan 10 17:29:35 UTC 2024
On Tue, 9 Jan 2024 07:31:51 GMT, Karthik P K <kpk at openjdk.org> wrote:
> In the `getHitInfo()` method of PrismTextLayout, RTL node orientation conditions were not considered, hence hit test values such as character index and insertion index values were incorrect.
>
> Added checks for RTL orientation of nodes and fixed the issue in `getHitInfo()` to calculate correct hit test values.
>
> Added system tests to validate the changes.
MonkeyTester encounters an NPE on launch:
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Cannot invoke "javafx.scene.Scene.getNodeOrientation()" because the return value of "javafx.scene.text.Text.getScene()" is null
at javafx.graphics/javafx.scene.text.Text.findRunIndex(Text.java:1042)
at javafx.graphics/javafx.scene.text.Text.hitTest(Text.java:1027)
at javafx.controls/com.sun.javafx.scene.control.skin.Utils.computeTruncationIndex(Utils.java:208)
at javafx.controls/com.sun.javafx.scene.control.skin.Utils.computeClippedText(Utils.java:281)
at javafx.controls/javafx.scene.control.skin.LabeledSkinBase.updateDisplayedText(LabeledSkinBase.java:1136)
at javafx.controls/javafx.scene.control.skin.LabeledSkinBase.layoutLabelInArea(LabeledSkinBase.java:552)
at javafx.controls/javafx.scene.control.skin.LabeledSkinBase.layoutLabelInArea(LabeledSkinBase.java:475)
at javafx.controls/javafx.scene.control.skin.TableCellSkinBase.layoutChildren(TableCellSkinBase.java:147)
at javafx.controls/javafx.scene.control.Control.layoutChildren(Control.java:612)
at javafx.controls/javafx.scene.control.Cell.layoutChildren(Cell.java:635)
at javafx.controls/javafx.scene.control.TableCell.layoutChildren(TableCell.java:711)
at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1208)
at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1215)
at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1215)
at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1215)
at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1215)
at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1215)
at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1215)
at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1215)
at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1215)
at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1215)
at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1215)
at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1215)
at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1215)
at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1215)
at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1215)
at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1215)
at javafx.graphics/javafx.scene.Parent.layout(Parent.java:1215)
at javafx.graphics/javafx.scene.Scene.doLayoutPass(Scene.java:595)
at javafx.graphics/javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2601)
at javafx.graphics/com.sun.javafx.tk.Toolkit.lambda$2(Toolkit.java:401)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at javafx.graphics/com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:400)
at javafx.graphics/com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:430)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:598)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:578)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:571)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$11(QuantumToolkit.java:352)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1323#issuecomment-1885288059
More information about the openjfx-dev
mailing list