Pārlūkot izejas kodu

Fix an issue causing views to render blank when scene rendering is skipped for a given iteration of the render loop (#8530)

* Prevent resize logic when no resize needs to take place

* Pull resize from conditional statement

* Added condition for resizing when rendering a view

* Added update to preview release notes
Liam Parker 5 gadi atpakaļ
vecāks
revīzija
1165683f7e

+ 1 - 0
dist/preview release/what's new.md

@@ -253,6 +253,7 @@
 - Fix crash when loading a .obj file with vertex colors ([Popov72](https://github.com/Popov72))
 - Fix skeleton viewer still visible when `isEnabled = false` ([Popov72](https://github.com/Popov72))
 - Fix crash with CSG when no uvs defined ([Popov72](https://github.com/Popov72))
+- Fix an issue causing views to render blank when scene rendering is skipped for a given iteration of the render loop ([elInfidel](https://github.com/elInfidel))
 
 ## Breaking changes
 

+ 4 - 1
src/Engines/Extensions/engine.views.ts

@@ -134,7 +134,10 @@ Engine.prototype._renderViews = function() {
         }
 
         // Set sizes
-        if (canvas.clientWidth && canvas.clientHeight) {
+        const dimsChanged =
+            canvas.width !== canvas.clientWidth ||
+            canvas.height !== canvas.clientHeight;
+        if (canvas.clientWidth && canvas.clientHeight && dimsChanged) {
             canvas.width = canvas.clientWidth;
             canvas.height = canvas.clientHeight;
             parent.width = canvas.clientWidth;