ソースを参照

Fixing fast rejection of Canvas intersection & positioning issue while fixed position is given.

nockawa 9 年 前
コミット
510a9c3464
2 ファイル変更5 行追加4 行削除
  1. 1 1
      src/Canvas2d/babylon.canvas2d.ts
  2. 4 3
      src/Canvas2d/babylon.prim2dBase.ts

+ 1 - 1
src/Canvas2d/babylon.canvas2d.ts

@@ -495,7 +495,7 @@
             ii.findFirstOnly = false;
 
             // Fast rejection: test if the mouse pointer is outside the canvas's bounding Info
-            if (!isCapture && !this.boundingInfo.doesIntersect(ii.pickPosition)) {
+            if (!isCapture && !this.levelBoundingInfo.doesIntersect(ii.pickPosition)) {
                 this._previousIntersectionList = this._actualIntersectionList;
                 this._actualIntersectionList = null;
                 this._previousOverPrimitive = this._actualOverPrimitive;

+ 4 - 3
src/Canvas2d/babylon.prim2dBase.ts

@@ -2816,9 +2816,10 @@
                 this._contentArea.copyFrom(Prim2DBase._icArea);
             }
 
-            let aPos = new Vector2(this._layoutAreaPos.x + this._marginOffset.x, this._layoutAreaPos.y + this._marginOffset.y);
-            this.actualPosition = aPos;
-
+            if (!this._position) {
+                let aPos = new Vector2(this._layoutAreaPos.x + this._marginOffset.x, this._layoutAreaPos.y + this._marginOffset.y);
+                this.actualPosition = aPos;
+            }
             if (isSizeAuto) {
                 this._lastAutoSizeArea = this.size;                
             }