Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inserting caret offset by css padding #285

Closed
terjedahl opened this issue Apr 7, 2016 · 2 comments
Closed

Inserting caret offset by css padding #285

terjedahl opened this issue Apr 7, 2016 · 2 comments

Comments

@terjedahl
Copy link
Contributor

When applying style to StyledTextArea such as: "-fx-padding: 10;", and then clicking in the text to insert the caret, the caret gets inserted 10px to the right of where I clicked - in practice more than one character later than where I tried to insert it.

@TomasMikula TomasMikula added this to the 0.7 milestone Sep 16, 2016
@JordanMartinez
Copy link
Contributor

I wasn't able to reproduce this issue via the example below

import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.TextArea;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import org.fxmisc.richtext.CharacterHit;
import org.fxmisc.richtext.InlineCssTextArea;

public class Moko extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) {
        InlineCssTextArea area = new InlineCssTextArea("One.\nTwo.\nThree.");
        area.setStyle("-fx-padding: 20;");
        Scene scene = new Scene(new StackPane(area), 500, 500);

        primaryStage.setScene(scene);
        primaryStage.show();
    }
}

@TomasMikula
Copy link
Member

Fixed by #396

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants