Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenwrite.git

fixed sync scrolling because textArea.estimatedScrollY changed behaviour from RichTextFX 0.7-M1 to 0.7-M2: - in 0.7-M1 it was in range 0 to textArea.totalHeightEstimate - in 0.7-M2 it is in range 0 to (textArea.totalHeightEstimate - textArea.height)

AuthorKarl Tauber <email>
Date2016-07-26 12:33:31 GMT+0200
Commitfc1074767f0746973823e620b80c3af4162a76a4
Parent3169e2f
Delta2 lines added, 2 lines removed
src/main/java/org/markdownwriterfx/editor/MarkdownEditorPane.java
ChangeListener<Double> scrollYListener = (observable, oldValue, newValue) -> {
double value = textArea.estimatedScrollYProperty().getValue().doubleValue();
- double maxValue = textArea.totalHeightEstimateProperty().getOrElse(0.).doubleValue();
- scrollY.set((maxValue != 0) ? Math.min(Math.max(value / maxValue, 0), 1) : 0);
+ double maxValue = textArea.totalHeightEstimateProperty().getOrElse(0.).doubleValue() - textArea.getHeight();
+ scrollY.set((maxValue > 0) ? Math.min(Math.max(value / maxValue, 0), 1) : 0);
};
textArea.estimatedScrollYProperty().addListener(scrollYListener);