use of org.reactfx.Guard in project RichTextFX by FXMisc.
the class GenericStyledArea method layoutChildren.
/* ********************************************************************** *
* *
* Layout *
* *
* ********************************************************************** */
@Override
protected void layoutChildren() {
Insets ins = getInsets();
visibleParagraphs.suspendWhile(() -> {
virtualFlow.resizeRelocate(ins.getLeft(), ins.getTop(), getWidth() - ins.getLeft() - ins.getRight(), getHeight() - ins.getTop() - ins.getBottom());
if (followCaretRequested) {
followCaretRequested = false;
try (Guard g = viewportDirty.suspend()) {
followCaret();
}
}
});
}