three-base 1.129.10 → 1.129.12
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/lib/ThreeBase.js +2 -8
- package/lib/ThreeBase.ts +2 -8
- package/package.json +1 -1
package/lib/ThreeBase.js
CHANGED
|
@@ -78,10 +78,7 @@ export default class ThreeBase extends EventDispatcher {
|
|
|
78
78
|
div.append(this.renderer.domElement);
|
|
79
79
|
// 监听容器的尺寸的改变
|
|
80
80
|
elementResizeEvent(div, () => {
|
|
81
|
-
|
|
82
|
-
let width = parseInt(rect.width);
|
|
83
|
-
let height = parseInt(rect.height);
|
|
84
|
-
this.resize(width, height);
|
|
81
|
+
this.resize(div.clientWidth, div.clientHeight);
|
|
85
82
|
});
|
|
86
83
|
// 如果上下文被销毁了, 就恢复上下文
|
|
87
84
|
if (this.isRendererContextLost) {
|
|
@@ -91,10 +88,7 @@ export default class ThreeBase extends EventDispatcher {
|
|
|
91
88
|
await new Promise(resolve => requestAnimationFrame(resolve));
|
|
92
89
|
this.renderer.domElement.style.opacity = "1";
|
|
93
90
|
}
|
|
94
|
-
|
|
95
|
-
let width = parseInt(rect.width);
|
|
96
|
-
let height = parseInt(rect.height);
|
|
97
|
-
this.resize(width, height);
|
|
91
|
+
this.resize(div.clientWidth, div.clientHeight);
|
|
98
92
|
// 开启时时渲染
|
|
99
93
|
threeUtils.removeEventListener("requestAnimationFrame", this.renderBindThis);
|
|
100
94
|
threeUtils.addEventListener("requestAnimationFrame", this.renderBindThis);
|
package/lib/ThreeBase.ts
CHANGED
|
@@ -94,10 +94,7 @@ export default class ThreeBase extends EventDispatcher {
|
|
|
94
94
|
|
|
95
95
|
// 监听容器的尺寸的改变
|
|
96
96
|
elementResizeEvent(div, () => {
|
|
97
|
-
|
|
98
|
-
let width = parseInt(rect.width);
|
|
99
|
-
let height = parseInt(rect.height);
|
|
100
|
-
this.resize(width, height);
|
|
97
|
+
this.resize(div.clientWidth, div.clientHeight);
|
|
101
98
|
});
|
|
102
99
|
|
|
103
100
|
// 如果上下文被销毁了, 就恢复上下文
|
|
@@ -109,10 +106,7 @@ export default class ThreeBase extends EventDispatcher {
|
|
|
109
106
|
this.renderer.domElement.style.opacity = "1";
|
|
110
107
|
}
|
|
111
108
|
|
|
112
|
-
|
|
113
|
-
let width = parseInt(rect.width);
|
|
114
|
-
let height = parseInt(rect.height);
|
|
115
|
-
this.resize(width, height);
|
|
109
|
+
this.resize(div.clientWidth, div.clientHeight);
|
|
116
110
|
|
|
117
111
|
// 开启时时渲染
|
|
118
112
|
threeUtils.removeEventListener("requestAnimationFrame", this.renderBindThis);
|