code-editor

Details

diff --git a/outputframe-app/elements/render-canvas/render-canvas.ts b/outputframe-app/elements/render-canvas/render-canvas.ts
index c8ecf26..f066787 100644
--- a/outputframe-app/elements/render-canvas/render-canvas.ts
+++ b/outputframe-app/elements/render-canvas/render-canvas.ts
@@ -28,10 +28,12 @@ export class RenderCanvas extends BaseElement {
             this.width = this.parentElement.clientWidth;
             this.height = this.parentElement.clientHeight;
 
-            this.canvas.style.width = this.width + "px";
-            this.canvas.style.height = this.width + "px";
-            this.canvas.setAttribute("width", this.width.toString());
-            this.canvas.setAttribute("height", this.width.toString());
+            var smallest = Math.min(this.width, this.height);
+
+            this.canvas.style.width = smallest + "px";
+            this.canvas.style.height = smallest + "px";
+            this.canvas.setAttribute("width", smallest.toString());
+            this.canvas.setAttribute("height", smallest.toString());
         }
     }