sebavan vor 6 Jahren
Ursprung
Commit
c15d5142cd

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

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

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

@@ -1,7 +1,7 @@
 import { Container } from "./container";
 import { AdvancedDynamicTexture } from "../advancedDynamicTexture";
 import { ValueAndUnit } from "../valueAndUnit";
-import { Nullable, Observer, Vector2, AbstractMesh, Observable, Vector3, Scene, Tools, Matrix, PointerEventTypes, Logger } from "babylonjs";
+import { Nullable, Observer, Vector2, AbstractMesh, Observable, Vector3, Scene, Tools, Matrix, PointerEventTypes, Logger, Polygon } from "babylonjs";
 import { Measure } from "../measure";
 import { Style } from "../style";
 import { Matrix2D, Vector2WithInfo } from "../math2D";
@@ -1087,7 +1087,7 @@ export class Control {
     protected invalidateRect() {
         if (this.host) {
             // Compute aabb of rotated container box (eg. to handle rotation)
-            var rectanglePoints = BABYLON.Polygon.Rectangle(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.left + this._currentMeasure.width, this._currentMeasure.top + this._currentMeasure.height);
+            var rectanglePoints = Polygon.Rectangle(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.left + this._currentMeasure.width, this._currentMeasure.top + this._currentMeasure.height);
             var min = new Vector2(Number.MAX_VALUE, Number.MAX_VALUE);
             var max = new Vector2(0, 0);
             this._invertTransformMatrix.invertToRef(this._invertTransformMatrix);

+ 1 - 1
gui/src/2D/controls/scrollViewers/scrollViewer.ts

@@ -2,7 +2,7 @@ import { Rectangle } from "../rectangle";
 import { Grid } from "../grid";
 import { Control } from "../control";
 import { Container } from "../container";
-import { PointerInfo, Observer, Nullable } from "babylonjs";
+import { PointerInfo, Observer, Nullable, PointerEventTypes } from "babylonjs";
 import { Measure } from "../../measure";
 import { AdvancedDynamicTexture } from "../../advancedDynamicTexture";
 import { _ScrollViewerWindow } from "./scrollViewerWindow";