Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: setting z-index range to a normal value and fixing a small semi … #1931

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export type GridMaterialType = {
/** Fade strength, default: 1 */
fadeStrength?: number
/** Fade from camera (1) or origin (0), or somewhere in between, default: camera */
fadeFrom?: number;
fadeFrom?: number
/** Material side, default: THREE.BackSide */
side?: THREE.Side
}
Expand Down
6 changes: 3 additions & 3 deletions src/web/Html.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export const Html: ForwardRefComponent<HtmlProps, HTMLDivElement> = /* @__PURE__
receiveShadow,
material,
geometry,
zIndexRange = [16777271, 0],
zIndexRange = [2, 0],
calculatePosition = defaultCalculatePosition,
as = 'div',
wrapperClass,
Expand Down Expand Up @@ -198,7 +198,7 @@ export const Html: ForwardRefComponent<HtmlProps, HTMLDivElement> = /* @__PURE__
const el = gl.domElement as HTMLCanvasElement

if (occlude && occlude === 'blending') {
el.style.zIndex = `${Math.floor(zIndexRange[0] / 2)}`
el.style.zIndex = `2`
el.style.position = 'absolute'
el.style.pointerEvents = 'none'
} else {
Expand Down Expand Up @@ -318,7 +318,7 @@ export const Html: ForwardRefComponent<HtmlProps, HTMLDivElement> = /* @__PURE__
else el.style.display = visible.current ? 'block' : 'none'
}

const halfRange = Math.floor(zIndexRange[0] / 2)
const halfRange = Math.floor(zIndexRange[0])
const zRange = occlude
? isRayCastOcclusion //
? [zIndexRange[0], halfRange]
Expand Down