Understanding the Centerline

There are expressions where the connections between the components of the rendering needs to be placed in a location other than just the top, middle or bottom of the box containing a component. The centerline is used to define another connection point for a component in a rendering that is used for these cases.

An example will illustrate the need for the Centerline. Consider this expression:

The rendering for the Logic.Equal object looks like this:

Note that the endpoints of the offsets connected to both the "a" and "b" parameters are shown in blue. This indicates that these offsets connect to the centerline of "a" and "b" rather than the middle of each parameter. You can also see this in the Properties List where the My offset connection property for the "b" parameter has the Centerline left value.

The Centerline of the Math.Div object is attached to the line between the two parameters as you can see in the rendering of this object. If you click on the Centerline node in the Rendering Tree, the Display Area is redrawn to show the location of the centerline and which component owns the centerline:

The location of the centerline is shown by a red line that goes all the way across the Display Area. The object that owns the centerline is shown with a red box around it.

So if we put a Math.Div object into the "b" parameter of a Logic.Equal object, as is the case in the expression we started with, and offset to the "b" parameter is connected to Centerline left, then as the parameters in numerator and denominator change, it will always be the case that the line between the numerator and denominator will be vertically aligned with the middle of the "=" symbol even if the height of the numerator is different from the height of the denominator, as it is in the example expression we started with. This allows the division line to stay centered with other terms in the equation, regardless of the height of its parameters.

Here's another example where the division line always remains centered in relation to other terms in the expression. This time using the Add object:

The centerline offset differs from the middle in that centerline horizontally aligns terms with other terms at the assigned centerline; whereas middle offset of a term is determined by the vertical midpoint.

By contrast, renderings that contain parentheses are typically constructed so that the offsets connect to the midpoint of the parameter, not the centerline:

Note that both of the offsets connected to the "a" parameter connect to the middle rather than the centerline, as you can see from the yellow endpoints or by looking at the Properties List for the parentheses symbols.

In every rendering there is always an object that owns the centerline. In renderings with groups, every group will also have an object that owns the centerline of the group. This is required so that we can connect components of a rendering to the centerline of a group when that's the appropriate way to construct a rendering.