File tree Expand file tree Collapse file tree
richtextfx/src/main/java/org/fxmisc/richtext Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323import javafx .collections .ObservableMap ;
2424import javafx .collections .ObservableSet ;
2525import javafx .collections .SetChangeListener ;
26- import javafx .collections .transformation .FilteredList ;
2726import javafx .geometry .Bounds ;
2827import javafx .geometry .Insets ;
2928import javafx .scene .Node ;
@@ -404,8 +403,15 @@ private void updateBackgroundShapes() {
404403 int start = 0 ;
405404
406405 // calculate shared values among consecutive nodes
407- FilteredList <Node > nodeList = getChildren ().filtered (node -> node instanceof TextExt );
408- for (Node node : nodeList ) {
406+ for (Node node : getManagedChildren ()) {
407+ if (!(node instanceof TextExt )) {
408+ // node is a custom objects (e.g. image)
409+ // - custom objects do not support background color, border and underline
410+ // - text length of custom objects is always 1
411+ start += 1 ;
412+ continue ;
413+ }
414+
409415 TextExt text = (TextExt ) node ;
410416 int end = start + text .getText ().length ();
411417
You can’t perform that action at this time.
0 commit comments