Skip to content

Commit

Permalink
fix(Html): use transform for perspective browser issues
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett committed Oct 21, 2023
1 parent 870d742 commit 73aebf7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/web/Html.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export const Html: ForwardRefComponent<HtmlProps, HTMLDivElement> = /* @__PURE__
}
el.style.width = size.width + 'px'
el.style.height = size.height + 'px'
el.style.perspective = isOrthographicCamera ? '' : `${fov}px`
el.style.transform = isOrthographicCamera ? '' : `perspective(${fov}px)`
if (transformOuterRef.current && transformInnerRef.current) {
transformOuterRef.current.style.transform = `${cameraTransform}${cameraMatrix}translate(${widthHalf}px,${heightHalf}px)`
transformInnerRef.current.style.transform = getObjectCSSMatrix(matrix, 1 / ((distanceFactor || 10) / 400))
Expand Down

0 comments on commit 73aebf7

Please sign in to comment.