< Rebol Programming
USAGE:
CENTER-FACE obj /with face
DESCRIPTION:
Center a face relative to parent (screen for windows) or a sibling face.
CENTER-FACE is a function value.
ARGUMENTS
- obj -- (Type: object)
REFINEMENTS
- /with -- Center relative to a sibling face.
- face -- (Type: object)
SOURCE CODE
center-face: func [
{Center a face relative to parent (screen for windows) or a sibling face.}
obj [object!]
/with "Center relative to a sibling face." face [object!]
][
if none? face [face: any [obj/parent-face system/view/screen-face]]
obj/offset: max 0x0 face/size - obj/size / 2 + either with [face/offset] [0x0]
obj
]
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.