Refresh Preview3D node with node.onMouseEnter (#2439)

This commit is contained in:
kvick-games
2025-02-05 18:26:45 -08:00
committed by GitHub
parent b700cc1824
commit f5c5a95bdc
2 changed files with 28 additions and 0 deletions

View File

@@ -29,6 +29,12 @@ app.registerExtension({
containerToLoad3D.set(container.id, load3d)
node.onMouseEnter = function () {
if (load3d) {
load3d.refreshViewport()
}
}
node.onResize = function () {
if (load3d) {
load3d.handleResize()
@@ -192,6 +198,12 @@ app.registerExtension({
containerToLoad3D.set(container.id, load3d)
node.onMouseEnter = function () {
if (load3d) {
load3d.refreshViewport()
}
}
node.onResize = function () {
if (load3d) {
load3d.handleResize()
@@ -362,6 +374,12 @@ app.registerExtension({
containerToLoad3D.set(container.id, load3d)
node.onMouseEnter = function () {
if (load3d) {
load3d.refreshViewport()
}
}
node.onResize = function () {
if (load3d) {
load3d.handleResize()
@@ -482,6 +500,12 @@ app.registerExtension({
containerToLoad3D.set(container.id, load3d)
node.onMouseEnter = function () {
if (load3d) {
load3d.refreshViewport()
}
}
node.onResize = function () {
if (load3d) {
load3d.handleResize()

View File

@@ -892,6 +892,10 @@ class Load3d {
this.handleResize()
}
refreshViewport() {
this.handleResize()
}
handleResize() {
const parentElement = this.renderer?.domElement?.parentElement