Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import java.util.function.IntFunction;
import java.util.function.IntSupplier;
import java.util.function.IntUnaryOperator;
import java.util.function.UnaryOperator;
import java.util.stream.Collectors;

import javafx.beans.NamedArg;
import javafx.beans.binding.Binding;
Expand Down Expand Up @@ -500,9 +498,6 @@ public Optional<Tuple2<Codec<PS>, Codec<SEG>>> getStyleCodecs() {

private Subscription subscriptions = () -> {};

// Remembers horizontal position when traversing up / down.
private Optional<ParagraphBox.CaretOffsetX> targetCaretOffset = Optional.empty();

private final VirtualFlow<Paragraph<PS, SEG, S>, Cell<Paragraph<PS, SEG, S>, ParagraphBox<PS, SEG, S>>> virtualFlow;

// used for two-level navigation, where on the higher level are
Expand Down Expand Up @@ -707,18 +702,6 @@ public GenericStyledArea(
* *
* ********************************************************************** */

/**
* Returns caret bounds relative to the viewport, i.e. the visual bounds
* of the embedded VirtualFlow.
*/
Optional<Bounds> getCaretBoundsInViewport() {
return virtualFlow.getCellIfVisible(getCurrentParagraph())
.map(c -> {
Bounds cellBounds = c.getNode().getCaretBounds();
return virtualFlow.cellToViewport(c, cellBounds);
});
}

/**
* Returns x coordinate of the caret in the current paragraph.
*/
Expand Down Expand Up @@ -1010,10 +993,6 @@ public void scrollBy(Point2D deltas) {
suspendVisibleParsWhile(() -> virtualFlow.scrollBy(deltas));
}

void show(double y) {
suspendVisibleParsWhile(() -> virtualFlow.show(y));
}

@Override
public void showParagraphInViewport(int paragraphIndex) {
suspendVisibleParsWhile(() -> virtualFlow.show(paragraphIndex));
Expand Down Expand Up @@ -1288,11 +1267,6 @@ private Optional<Bounds> getRangeBoundsOnScreen(int paragraphIndex, int from, in
.map(c -> c.getNode().getRangeBoundsOnScreen(from, to));
}

private Optional<Bounds> getCaretBoundsOnScreen() {
return virtualFlow.getCellIfVisible(getCurrentParagraph())
.map(c -> c.getNode().getCaretBoundsOnScreen());
}

public final Optional<Bounds> getCaretBoundsOnScreen(int paragraphIndex) {
return virtualFlow.getCellIfVisible(paragraphIndex)
.map(c -> c.getNode().getCaretBoundsOnScreen());
Expand Down Expand Up @@ -1366,7 +1340,7 @@ private void suspendVisibleParsWhile(Runnable runnable) {
}

void clearTargetCaretOffset() {
targetCaretOffset = Optional.empty();
mainCaret.clearTargetOffset();
}

ParagraphBox.CaretOffsetX getTargetCaretOffset() {
Expand Down