CenterRectCelListInSRect

Centers a list of cels within an SRect.

Synopsis

void CenterRectCelListInSRect(CCB *cel, SRect *rect)

Description

Centers a list of one or more cels over or within the specified rectangle. The list of cels is treated as if it were a single logical entity. The first cel in the list is centered, then the X/Y coordinates of all remaining cels in the list are modified so that all cels maintain their original positional relationships. This is especially useful when the first cel in the list encompasses the area occupied by all the other cels; the effect is to center the group of cels as if they were all one cel.

The ccb_XPos and ccb_YPos fields are modified in the CCBs; other CCB fields are not modified. The centering is based on the first cel's projected size, not its source data size. If the first cel is projected to a non-rectangular shape, the result is invalid.

Arguments

cel
Pointer to a list of one or more cels to be centered.
rect
Pointer to an SRect within which the cels are to be centered.

Implementation

Library call implemented in lib3do.lib.

Associated Files

lib3do.lib, celutils.h

See Also

CenterRectCelListInCRect, CenterRectAACelInSRect, CenterRectCelInSRect