Search in sources :

Example 1 with Guard

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();
            }
        }
    });
}
Also used : Insets(javafx.geometry.Insets) Guard(org.reactfx.Guard)

Aggregations

Insets (javafx.geometry.Insets)1 Guard (org.reactfx.Guard)1