JDK-8125260 : ScrollPane RTL orientation, Text in the ScrollPane got mirrored.
  • Type: Bug
  • Component: javafx
  • Sub-Component: scenegraph
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Cannot Reproduce
  • Submitted: 2012-11-09
  • Updated: 2015-06-17
  • Resolved: 2013-02-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Resolved
Related Reports
Blocks :  
Blocks :  
Blocks :  
Relates :  
Relates :  
Description
Create an application with several Texts in ScrollPane, set orientation of Scene to RTL. The Texts got mirrored. Please refer to the test program and snapshot.
Comments
Not reproducible in 8.0 b78.
28-02-2013

Yup, thanks!
09-11-2012

The difference between the two test cases is that ScrollPane doesn't add the content to the scene graph until later when the skin is created (based on information from CSS). The content subtree needs a recursive invalidation of transforms at this point.
09-11-2012

> The transformDirty flag in Node is not updated recursively when a parent is added to the scene graph Like you said if I had read the comment.
09-11-2012

Text needs to set the default orientation to LTR. If an application explicitly sets orientation to RTL, then this could be used (as Felipe suggested a while back) to indicate that the BIDI algorithm should assume the text will be RTL. I think we all agree the text should not draw backwards. The fact that ScrollPane gets it wrong looks like a bug in ScrollPane (unless it is a general bug where the tranform is not inherited deeply through the hierarchy). I'll attach a test case that shows that other parents get the orientation of text right without being explicitly set. Could ScrollPane be copying something to a temporary image?
09-11-2012

The transformDirty flag in Node is not updated recursively when a parent is added to the scene graph. Adding the following as a test proves that this bug would be fixed if transformDirty is set to true for Text: void updateLocalToParentTransform() { - if (transformDirty) { + if (this instanceof javafx.scene.text.Text || transformDirty) {
09-11-2012

Workaround: Add a call to group.setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT) in the application.
09-11-2012

The Text node is not being explicitly mirrored in this case, but since the whole scenegraph is mirrored, the Text node needs to be "unmirrored" (i.e. flipped relative to its parent) when the parent (a Group) is added to the ScrollPane. See the note about this in RT-26139. A related problem is that Text should not rely on just calling setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT) in its constructor to avoid being mirrored, as that can easily be overridden afterwards. Instead it should override isAutomaticallyMirrored() to return false. In fact, the nodeOrientation property should be used in Text to control alignment, not mirroring.
09-11-2012