Skip to content

Commit

Permalink
Added showParagraphAtCenter (#1054)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jugen authored Nov 15, 2021
1 parent 5a958fe commit 0582484
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,11 @@ public void showParagraphRegion(int paragraphIndex, Bounds region) {
suspendVisibleParsWhile(() -> virtualFlow.show(paragraphIndex, region));
}

public void showParagraphAtCenter(int paragraphIndex) {
double offset = Math.floor( getHeight() / 2.0 );
suspendVisibleParsWhile(() -> virtualFlow.showAtOffset(paragraphIndex,offset));
}

@Override
public void requestFollowCaret() {
followCaretRequested = true;
Expand Down

0 comments on commit 0582484

Please sign in to comment.