three-base 2.0.63 → 2.0.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ThreeBase.js +7 -4
- package/ThreeBase.ts +7 -4
- package/package.json +1 -1
package/ThreeBase.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: xiaosihan
|
|
3
3
|
* @Date: 2021-12-20 13:38:22
|
|
4
4
|
* @Last Modified by: xiaosihan
|
|
5
|
-
* @Last Modified time: 2024-
|
|
5
|
+
* @Last Modified time: 2024-08-10 04:23:41
|
|
6
6
|
*/
|
|
7
7
|
import { round } from "lodash";
|
|
8
8
|
import { AxesHelper, Box3, DepthFormat, DepthTexture, EventDispatcher, GridHelper, LinearFilter, MOUSE, Mesh, NoBlending, NormalBlending, OrthographicCamera, PerspectiveCamera, RGBAFormat, Scene, TOUCH, UnsignedShortType, Vector2, Vector3, WebGLRenderTarget, WebGLRenderer } from "three";
|
|
@@ -132,10 +132,13 @@ export default class ThreeBase extends EventDispatcher {
|
|
|
132
132
|
div.append(this.renderer.domElement);
|
|
133
133
|
if (this.rendererLost) {
|
|
134
134
|
this.renderer.forceContextRestore();
|
|
135
|
-
this.renderer.domElement.style.opacity = "1";
|
|
136
|
-
this.needRender = true;
|
|
137
|
-
await new Promise(resolve => setTimeout(resolve, 100));
|
|
138
135
|
this.needRender = true;
|
|
136
|
+
setTimeout(() => {
|
|
137
|
+
this.needRender = true;
|
|
138
|
+
}, 100);
|
|
139
|
+
setTimeout(() => {
|
|
140
|
+
this.renderer.domElement.style.opacity = "1";
|
|
141
|
+
}, 200);
|
|
139
142
|
}
|
|
140
143
|
this.setSize(div.clientWidth, div.clientHeight);
|
|
141
144
|
// 开启时时渲染
|
package/ThreeBase.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: xiaosihan
|
|
3
3
|
* @Date: 2021-12-20 13:38:22
|
|
4
4
|
* @Last Modified by: xiaosihan
|
|
5
|
-
* @Last Modified time: 2024-
|
|
5
|
+
* @Last Modified time: 2024-08-10 04:23:41
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { add, round } from "lodash";
|
|
@@ -151,10 +151,13 @@ export default class ThreeBase extends EventDispatcher {
|
|
|
151
151
|
|
|
152
152
|
if (this.rendererLost) {
|
|
153
153
|
this.renderer.forceContextRestore();
|
|
154
|
-
this.renderer.domElement.style.opacity = "1";
|
|
155
|
-
this.needRender = true;
|
|
156
|
-
await new Promise(resolve => setTimeout(resolve, 100));
|
|
157
154
|
this.needRender = true;
|
|
155
|
+
setTimeout(() => {
|
|
156
|
+
this.needRender = true;
|
|
157
|
+
}, 100);
|
|
158
|
+
setTimeout(() => {
|
|
159
|
+
this.renderer.domElement.style.opacity = "1";
|
|
160
|
+
}, 200);
|
|
158
161
|
}
|
|
159
162
|
|
|
160
163
|
this.setSize(div.clientWidth, div.clientHeight);
|