Rebol 编程/center-face
外观
< Rebol 编程
CENTER-FACE obj /with face
将一个面相对于父级(窗口的屏幕)或兄弟面居中。
CENTER-FACE 是一个函数值。
- obj -- (类型:对象)
- /with -- 相对于兄弟面居中。
- face -- (类型:对象)
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 ]