exitNodeUntil

Type: Function

Exit the ancestry of the current position Exiting works as following:

Other

      O
     / \
    A   X
   / \
  B   C
     / \
    D   E

Given:

  • A position under the empty E

  • A being the node which must be exited

The position after A will be the result.

However, given:

  • A position before C

  • A being the node which must be exited

The exit will fail, as the position gets trapped between B and C.

Furthermore, given:

  • A position between under the empty E

  • C being the node which must be exited

The position after C will be the result, as it may be reached.

When exiting a tree having just one branch, i.e. none of the nodes have siblings, a bias is taken to before. As soon as a choice has to be made, the direction is chosen. Example:

Other

    A
  / |
 B  C
    |
    D

When exiting from D, exiting C, brings us before C When exiting from D, exiting A, brings us after A, since no direction had to be chosen before

Refer to primitives for more information on how to include this primitive.

Arguments

  1. position

    (Required)

    The position to start exiting from

  2. blueprint

    (Required)

    Type: Blueprint

    The blueprint to perform the exit in

  3. nodeToExit

    (Required)

    Type: Node

    The node which must be exited for this to be successful

  4. format

    (Required)

    Type: Format

    The format to use for detecting detached nodes

  5. positionAfterExit

    (Required)

    The position at where the exit brought us, before or after the nodeToExit

  6. options

    (Optional)

    Type: Object

    Properties

Returns

Type: Boolean

The success of the exit.