You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FixesFXMisc/RichTextFX#1091 Thin horizontal lines appear between lines of text when rapidly scrolling vertically
Also fixesFXMisc/RichTextFX#1092 Horizontal scrolling of a CodeArea can result in large empty blocks in the upper right of the viewport (although unfortunately white blocks still briefly flash with this change).
But farther, when this action goes to VirtualFlow class - to method:
void setLengthOffset(double pixels) {
double total = totalLengthEstimateProperty().getOrElse(0.0);
double length = sizeTracker.getViewportLength();
double max = Math.max(total - length, 0);
double current = lengthOffsetEstimate.getValue();
if(pixels > max) pixels = max;
if(pixels < 0) pixels = 0;
double diff = pixels - current;
if(diff == 0) {
// do nothing
} else if(Math.abs(diff) <= length) { // distance less than one screen
navigator.scrollCurrentPositionBy(diff);
} else {
jumpToAbsolutePosition(pixels);
}
}
The incoming pixels value is rounded, but value in variable current is not rounded, and when we compute diff:
double diff = pixels - current;
... there is very often computed value 0.5 (but it should be 0) and VirtualFlow moves visible content by this diff (navigator.scrollCurrentPositionBy(diff)) instead of // do nothing
(This setLengthOffset method is executed there because is bound by property in VirtualFlow constructor: lengthOffsetEstimate = new StableBidirectionalVar<>( sizeTracker.lengthOffsetEstimateProperty(), this::setLengthOffset );)
I Have created a proposal fix for this in my PR: #112
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes FXMisc/RichTextFX#1091 Thin horizontal lines appear between lines of text when rapidly scrolling vertically
Also fixes FXMisc/RichTextFX#1092 Horizontal scrolling of a CodeArea can result in large empty blocks in the upper right of the viewport (although unfortunately white blocks still briefly flash with this change).