Skip to content

Commit

Permalink
set caret unmanaged
Browse files Browse the repository at this point in the history
  • Loading branch information
jperedadnr committed Nov 12, 2024
1 parent 5180602 commit 5f4b08f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rta/src/main/java/com/gluonhq/richtextarea/ParagraphTile.java
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ public Layer(int start, int end, boolean isTableCell) {
textFlow.setOnMousePressed(this::mousePressedListener);

caretShape.setFocusTraversable(false);
caretShape.setManaged(false);
caretShape.getStyleClass().add("caret");
selectionShape.getStyleClass().setAll("selection");
textBackgroundColorPaths.addListener(this::updateLayer);
Expand All @@ -393,9 +394,7 @@ public Layer(int start, int end, boolean isTableCell) {

@Override
protected double computePrefHeight(double width) {
// take into account caret height: whether it is visible or not,
// the layer's height doesn't change
return Math.max(caretShape.getLayoutBounds().getHeight(), textFlow.prefHeight(textFlow.getPrefWidth()) + 1);
return textFlow.prefHeight(textFlow.getPrefWidth()) + 1;
}

@Override
Expand Down

0 comments on commit 5f4b08f

Please sign in to comment.