Summary
This change adds new methods to the TextFlow which work correctly in the presence of non-empty insets (borders/padding). For backward compatibility, the old buggy methods are getting deprecated (not for removal). Also, adds new methods in Text which provide missing functionality.
Problem
A number of methods in TextFlow fail to return correct values in the presence of non-empty insets (i.e. when either padding or border are set):
caretShape
hitTest
rangeShape
Additionally, the current API fail to provide strike-through shape, and account for line spacing in the range shape, a problem shared between the TextFlow and the Text classes.
Solution
The solution is two-fold:
- deprecate the buggy methods (not for removal), adding explanations in their javadoc comments
- add new methods that behave correctly in the presence of non-empty insets and/or implementing the missing functionality.
The proposed solution retains the buggy methods for the purposes of backward compatibility in applications which employ the workarounds, while providing new APIs with additional parameters similar to those offered by the new TextLayout API https://bugs.openjdk.org/browse/JDK-8341670.
The newly added methods are consistent with the LayoutInfo::getStrikeThroughGeometry by taking into account the Node's borders/insets (seeJDK-8341438).
This change adds new methods to the TextFlow which work correctly in the presence of non-empty insets (borders/padding). For backward compatibility, the old buggy methods are getting deprecated (not for removal). Also, adds new methods in Text which provide missing functionality.
Problem
A number of methods in TextFlow fail to return correct values in the presence of non-empty insets (i.e. when either padding or border are set):
caretShape
hitTest
rangeShape
Additionally, the current API fail to provide strike-through shape, and account for line spacing in the range shape, a problem shared between the TextFlow and the Text classes.
Solution
The solution is two-fold:
- deprecate the buggy methods (not for removal), adding explanations in their javadoc comments
- add new methods that behave correctly in the presence of non-empty insets and/or implementing the missing functionality.
The proposed solution retains the buggy methods for the purposes of backward compatibility in applications which employ the workarounds, while providing new APIs with additional parameters similar to those offered by the new TextLayout API https://bugs.openjdk.org/browse/JDK-8341670.
The newly added methods are consistent with the LayoutInfo::getStrikeThroughGeometry by taking into account the Node's borders/insets (see
- csr for
-
JDK-8358000 Additional geometry-based Text/TextFlow APIs
-
- Closed
-
- duplicates
-
JDK-8341438 TextFlow: incorrect caretShape(), hitTest(), rangeShape() with non-empty padding/border
-
- Closed
-
- is blocked by
-
JDK-8341670 [Text,TextFlow] Public API for Text Layout Info
-
- Resolved
-
- relates to
-
JDK-8341438 TextFlow: incorrect caretShape(), hitTest(), rangeShape() with non-empty padding/border
-
- Closed
-
- links to
-
Commit(master) openjdk/jfx/04c5e40c
-
Review(master) openjdk/jfx/1817
(1 links to)