v0.0.3
This commit is contained in:
@@ -90,7 +90,7 @@ public class SelectableLabel extends TextArea implements TimiFXUI, TimiFXUI.Colo
|
||||
bindTextStyle(paragraphNodes.getChildren());
|
||||
widthProperty().addListener((obs, oldValue, newValue) -> {
|
||||
if (oldValue.doubleValue() < newValue.doubleValue()) {
|
||||
if (paragraphNodes.getChildren().get(0) instanceof Text text) {
|
||||
if (paragraphNodes.getChildren().getFirst() instanceof Text text) {
|
||||
setPrefHeight(Utils.computeTextHeight(getFont(), getText(), getWidth(), text.getBoundsType()));
|
||||
}
|
||||
}
|
||||
@@ -108,8 +108,8 @@ public class SelectableLabel extends TextArea implements TimiFXUI, TimiFXUI.Colo
|
||||
* @param list 文本节点,必须是 {@link Text}
|
||||
*/
|
||||
private void bindTextStyle(List<? extends Node> list) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
if (list.get(i) instanceof Text text) {
|
||||
for (Node node : list) {
|
||||
if (node instanceof Text text) {
|
||||
text.fillProperty().bind(textFillProperty);
|
||||
text.textAlignmentProperty().bind(textAlignmentProperty);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user