Skip to content

Commit

Permalink
Updated visibleParToAllParIndex (#1002)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jugen committed Feb 10, 2021
1 parent 4cc49c3 commit e9c112b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,14 @@ public final int visibleParToAllParIndex(int visibleParIndex) {
getVisibleParagraphs().size() - 1, visibleParIndex)
);
}
return virtualFlow.visibleCells().get( visibleParIndex ).getNode().getIndex();

Cell<Paragraph<PS,SEG,S>, ParagraphBox<PS,SEG,S>> visibleCell = null;

if ( visibleParIndex > 0 ) visibleCell = virtualFlow.visibleCells().get( visibleParIndex );
else visibleCell = virtualFlow.getCellIfVisible( virtualFlow.getFirstVisibleIndex() )
.orElseGet( () -> virtualFlow.visibleCells().get( visibleParIndex ) );

return visibleCell.getNode().getIndex();
}

@Override
Expand Down

0 comments on commit e9c112b

Please sign in to comment.