BlueGit

timfa frameworkv3

fix incorrect size on update step 1

timfa Tim · pushed by timfa

Authored 2024-03-23 · 2 years ago

Hash
d111a33c2add760bd341e645bb676f1e37d7a6f6
Parent
49cf1a6d
1 file changed +11 −4
framework/engine/scene.js +11 −4
@@ -49,6 +49,8 @@ class Scene
49 49
50 50 this.cv_canvas = document.getElementById(this.id);
51 51 this.cv_context = this.cv_canvas.getContext('2d');
52
53 this.g_fixSize();
52 54 }
53 55
54 56 setPrimary ()
@@ -157,11 +159,8 @@ class Scene
157 159 }
158 160 }
159 161
160 draw ()
162 g_fixSize ()
161 163 {
162 if (this.destroyed)
163 return;
164
165 164 if (this.displayMode == Scene.DisplayModes.relativeToParent)
166 165 {
167 166 if (this.parentScene)
@@ -207,6 +206,14 @@ class Scene
207 206 this.py = this.real_position.y;
208 207 this.canvas.style.top = this.real_position.y;
209 208 }
209 }
210
211 draw ()
212 {
213 if (this.destroyed)
214 return;
215
216 this.g_fixSize();
210 217
211 218 if (this.renderBackground)
212 219 {
@@ -49,6 +49,8 @@ class Scene
49
49
50 this.cv_canvas = document.getElementById(this.id);
50 this.cv_canvas = document.getElementById(this.id);
51 this.cv_context = this.cv_canvas.getContext('2d');
51 this.cv_context = this.cv_canvas.getContext('2d');
52
53 this.g_fixSize();
52 }
54 }
53
55
54 setPrimary ()
56 setPrimary ()
@@ -157,11 +159,8 @@ class Scene
157 }
159 }
158 }
160 }
159
161
160 draw ()
162 g_fixSize ()
161 {
163 {
162 if (this.destroyed)
163 return;
164
165 if (this.displayMode == Scene.DisplayModes.relativeToParent)
164 if (this.displayMode == Scene.DisplayModes.relativeToParent)
166 {
165 {
167 if (this.parentScene)
166 if (this.parentScene)
@@ -207,6 +206,14 @@ class Scene
207 this.py = this.real_position.y;
206 this.py = this.real_position.y;
208 this.canvas.style.top = this.real_position.y;
207 this.canvas.style.top = this.real_position.y;
209 }
208 }
209 }
210
211 draw ()
212 {
213 if (this.destroyed)
214 return;
215
216 this.g_fixSize();
210
217
211 if (this.renderBackground)
218 if (this.renderBackground)
212 {
219 {