ソースを参照

Merge pull request #9605 from Popov72/fix-multicanvas-ratio

Fix canvas not resized correctly in a multi-canvas scenario
David Catuhe 4 年 前
コミット
00c1e9a6fa

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

@@ -73,6 +73,7 @@
 - Fix function creation inside regularly called freeCameraMouseWheelInput method leading to excessive GC load. ([mrdunk](https://github.com/mrdunk))
 - Fix clip plane not reset to the rigth value when using mirrors ([Popov72](https://github.com/Popov72))
 - Fix lens flares not working in right handed system ([Popov72](https://github.com/Popov72))
+- Fix canvas not resized correctly in a multi-canvas scenario ([Popov72](https://github.com/Popov72))
 
 ## Breaking changes
 

+ 2 - 2
src/Engines/Extensions/engine.views.ts

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