Closed terjedahl closed 7 years ago
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();
}
}
Fixed by #396
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.