Skip to content

InlineCssTextArea.getStylesheets().clear() add 1px to underline width. #1257

@PavelTurk

Description

@PavelTurk

This is the test code:

public class RichTextFxTest extends Application {

    @Override
    public void start(Stage stage) throws Exception {
        var textArea1 = new InlineCssTextArea();
        prepare(textArea1);
        var textArea2 = new InlineCssTextArea();
        prepare(textArea2);

        textArea1.getStylesheets().clear();//LINE X

        var box = new VBox(new Label("TextArea1"), textArea1, new Label("TextArea2"), textArea2);
        var scene = new Scene(box, 300, 300);
        stage.setScene(scene);
        stage.show();
    }

    private void prepare(InlineCssTextArea textArea) {
        textArea.appendText("Default style string\n");
        textArea.append("Current style string\n",
                "-rtfx-underline-color: black;-rtfx-underline-width: 1px;-rtfx-underline-offset: 2px");
    }
}

And this is the result:
Screenshot from 2024-12-01 12-28-17

If LINE X is commented, then the result is:

Screenshot from 2024-12-01 12-28-33

As you see the line in the first picture is about 2px, while the line in the second one is 1px.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions