-
Notifications
You must be signed in to change notification settings - Fork 1
CSSLayoutObject
Manages it self positioning, scaling and rotation relative to its parent CSSLayout in relation to the referenced HTMLElement. Must be a CSSLayout's Child.
Emulate CSS's object-fit property, can be "contain", "fill" or "cover", default "contain".
The reference HTMLElement.
Set to true to recompute the Object3D's boundingBox (less performant).
Set to true to recompute the related HTMLElement's clientBoundingBox (less performant), default false.
constructor(domElement: HTMLElement | string, fit: "cover" | "contain" | "fill")CSSLayout child object will be mapped in reference to the domElement.
-
domElement: The reference element, can be anHTMLElementor a CSS querySelector string, example"#my-3d-model". -
fit: Emulate CSS'sobject-fitproperty, can be"contain","fill"or"cover", default"contain".
fitLayout(updateElement: boolean, updateObject: boolean)Fit the object relative to its parent CSSLayout while mapping the transformations of the referenced HTMLElement.
-
updateElement: Set totrueto recompute the relatedHTMLElement'sclientBoundingBox(less performant), defaultfalse. -
updateObject: Set totrueto recompute theObject3D'sboundingBox(less performant).
Event triggered before fitting any CSSLayoutObjectchild objects, useful for making adjustments before computing the transformations.
Event triggered after fitting all the CSSLayoutObject child objects, useful for making post transformation adjustments.