David `Deltakosh` Catuhe 5 anni fa
parent
commit
7d1517e26b

+ 4 - 0
Playground/src/components/examplesComponent.tsx

@@ -80,6 +80,10 @@ export class ExamplesComponent extends React.Component<IExamplesComponentProps,
 
     private _onLoadPG(id: string) {
         this.props.globalState.onLoadRequiredObservable.notifyObservers(id);
+
+        if (window.innerWidth < this.props.globalState.MobileSizeTrigger) {
+            this.props.globalState.onExamplesDisplayChangedObservable.notifyObservers();
+        }
     }
 
     public render() {

+ 12 - 2
Playground/src/components/rendererComponent.tsx

@@ -66,6 +66,14 @@ export class RenderingComponent extends React.Component<IRenderingComponentProps
                 this.props.globalState.onRunRequiredObservable.notifyObservers();
             });
         }
+
+        window.addEventListener("resize", () => {
+            if (!this._engine) {
+                return;
+            }
+
+            this._engine.resize();
+        });
     }
 
     private async _compileAndRunAsync() {
@@ -202,8 +210,10 @@ export class RenderingComponent extends React.Component<IRenderingComponentProps
                     return;
                 }
 
-                if (canvas.width !== canvas.clientWidth || canvas.height !== canvas.clientHeight) {
-                    this._engine.resize();
+                if (this.props.globalState.runtimeMode === RuntimeMode.Editor && window.innerWidth > this.props.globalState.MobileSizeTrigger) {
+                    if (canvas.width !== canvas.clientWidth || canvas.height !== canvas.clientHeight) {
+                        this._engine.resize();
+                    }
                 }
 
                 if (this._scene.activeCamera || this._scene.activeCameras.length > 0) {

+ 2 - 2
Playground/src/scss/examples.scss

@@ -65,7 +65,7 @@
 
         .example-category { 
             .example-category-title { 
-                background: #BB464B;
+                background: #3F3361;
                 margin: 10px 0;
                 color: white;   
                 font-size: 22px;
@@ -85,7 +85,7 @@
                 cursor: pointer;
 
                 &:hover {
-                    outline: #BB464B solid 2px;
+                    outline: #3F3361 solid 2px;
                 }
 
                 &:active {

+ 1 - 0
Playground/src/scss/hamburgerMenu.scss

@@ -45,6 +45,7 @@
     transform: translateX(-200px);
     opacity: 0;
     transition: all 0.2s ease;
+    z-index: 10;
 
     &.background-ts {
         .command-button, .command-dropdown  {