centered windozzz
This commit is contained in:
@@ -276,12 +276,19 @@ class WindozDomContent extends View {
|
||||
left = box.x ? box.x : defaults.x
|
||||
top = box.y ? box.y : defaults.y
|
||||
width = box.w ? box.w : defaults.w
|
||||
height = box.x ? box.h : defaults.h
|
||||
height = box.h ? box.h : defaults.h
|
||||
} else {
|
||||
left = defaults.x
|
||||
top = defaults.y
|
||||
width = defaults.w
|
||||
height = defaults.h
|
||||
height = defaults.h
|
||||
const ws = document.querySelector('[eicapp] .app-workspace')?.getBoundingClientRect()
|
||||
const areaLeft = ws?.left ?? 0
|
||||
const areaTop = ws?.top ?? 0
|
||||
const areaWidth = ws?.width ?? window.innerWidth
|
||||
const areaHeight = ws?.height ?? window.innerHeight
|
||||
if(left === 'center') left = Math.round(areaLeft + (areaWidth - width) / 2)
|
||||
if(top === 'center') top = Math.round(areaTop + (areaHeight - height) / 2)
|
||||
}
|
||||
return({
|
||||
width: `${width}px`,
|
||||
|
||||
Reference in New Issue
Block a user