Browse Source

Merge fix

sebavan 6 years ago
parent
commit
12f052f089

+ 6 - 3
gui/src/2D/advancedDynamicTexture.ts

@@ -661,19 +661,22 @@ export class AdvancedDynamicTexture extends DynamicTexture {
         this._attachToOnPointerOut(scene);
         this._attachToOnPointerOut(scene);
     }
     }
     /** @hidden */
     /** @hidden */
-    private onClipboardCopy = (evt: ClipboardEvent) => {
+    private onClipboardCopy = (rawEvt: Event) => {
+        const evt = rawEvt as ClipboardEvent;
         let ev = new ClipboardInfo(ClipboardEventTypes.COPY, evt);
         let ev = new ClipboardInfo(ClipboardEventTypes.COPY, evt);
         this.onClipboardObservable.notifyObservers(ev);
         this.onClipboardObservable.notifyObservers(ev);
         evt.preventDefault();
         evt.preventDefault();
     }
     }
     /** @hidden */
     /** @hidden */
-    private onClipboardCut = (evt: ClipboardEvent) => {
+    private onClipboardCut = (rawEvt: Event) => {
+        const evt = rawEvt as ClipboardEvent;
         let ev = new ClipboardInfo(ClipboardEventTypes.CUT, evt);
         let ev = new ClipboardInfo(ClipboardEventTypes.CUT, evt);
         this.onClipboardObservable.notifyObservers(ev);
         this.onClipboardObservable.notifyObservers(ev);
         evt.preventDefault();
         evt.preventDefault();
     }
     }
     /** @hidden */
     /** @hidden */
-    private onClipboardPaste = (evt: ClipboardEvent) => {
+    private onClipboardPaste = (rawEvt: Event) => {
+        const evt = rawEvt as ClipboardEvent;
         let ev = new ClipboardInfo(ClipboardEventTypes.PASTE, evt);
         let ev = new ClipboardInfo(ClipboardEventTypes.PASTE, evt);
         this.onClipboardObservable.notifyObservers(ev);
         this.onClipboardObservable.notifyObservers(ev);
         evt.preventDefault();
         evt.preventDefault();

+ 1 - 1
gui/src/2D/controls/container.ts

@@ -340,7 +340,7 @@ export class Container extends Control {
         while (this._rebuildLayout && rebuildCount < 3);
         while (this._rebuildLayout && rebuildCount < 3);
 
 
         if (rebuildCount >= 3) {
         if (rebuildCount >= 3) {
-            BABYLON.Tools.Error(`Layout cycle detected in GUI (Container name=${this.name}, uniqueId=${this.uniqueId})`);
+            Logger.Error(`Layout cycle detected in GUI (Container name=${this.name}, uniqueId=${this.uniqueId})`);
         }
         }
 
 
         context.restore();
         context.restore();

+ 2 - 2
gui/src/2D/controls/control.ts

@@ -1100,7 +1100,7 @@ export class Control {
     protected invalidateRect(left: number, top: number, right: number, bottom: number) {
     protected invalidateRect(left: number, top: number, right: number, bottom: number) {
         if (this.host && this.host.useInvalidateRectOptimization) {
         if (this.host && this.host.useInvalidateRectOptimization) {
             // Compute AABB of transformed container box (eg. to handle rotation and scaling)
             // Compute AABB of transformed container box (eg. to handle rotation and scaling)
-            var rectanglePoints = BABYLON.Polygon.Rectangle(left, top, right, bottom);
+            var rectanglePoints = Polygon.Rectangle(left, top, right, bottom);
             var min = new Vector2(Number.MAX_VALUE, Number.MAX_VALUE);
             var min = new Vector2(Number.MAX_VALUE, Number.MAX_VALUE);
             var max = new Vector2(0, 0);
             var max = new Vector2(0, 0);
             for (var i = 0; i < 4; i++) {
             for (var i = 0; i < 4; i++) {
@@ -1256,7 +1256,7 @@ export class Control {
             while (this._rebuildLayout && rebuildCount < 3);
             while (this._rebuildLayout && rebuildCount < 3);
 
 
             if (rebuildCount >= 3) {
             if (rebuildCount >= 3) {
-                BABYLON.Tools.Error(`Layout cycle detected in GUI (Control name=${this.name}, uniqueId=${this.uniqueId})`);
+                Logger.Error(`Layout cycle detected in GUI (Control name=${this.name}, uniqueId=${this.uniqueId})`);
             }
             }
 
 
             context.restore();
             context.restore();