Commit 37670302 authored by rockyl's avatar rockyl

修复touch阻隔的问题

parent 6feab7b4
...@@ -33,7 +33,7 @@ export default class InteractComponent extends ScillaComponent { ...@@ -33,7 +33,7 @@ export default class InteractComponent extends ScillaComponent {
} }
_dealGlobalTouchBegin(e) { _dealGlobalTouchBegin(e): boolean {
let interrupt = super._dealGlobalTouchBegin(e); let interrupt = super._dealGlobalTouchBegin(e);
const hitOn = this.hitTest(e); const hitOn = this.hitTest(e);
...@@ -43,10 +43,10 @@ export default class InteractComponent extends ScillaComponent { ...@@ -43,10 +43,10 @@ export default class InteractComponent extends ScillaComponent {
this._dealTouchOver(e); this._dealTouchOver(e);
} }
return hitOn && interrupt; return hitOn && (interrupt || this.touchInterrupt);
} }
_dealGlobalTouchMove(e) { _dealGlobalTouchMove(e): boolean {
let interrupt = super._dealGlobalTouchMove(e); let interrupt = super._dealGlobalTouchMove(e);
const hitOn = this.hitTest(e); const hitOn = this.hitTest(e);
...@@ -57,10 +57,10 @@ export default class InteractComponent extends ScillaComponent { ...@@ -57,10 +57,10 @@ export default class InteractComponent extends ScillaComponent {
this._dealTouchOut(e); this._dealTouchOut(e);
} }
return hitOn && interrupt; return hitOn && (interrupt || this.touchInterrupt);
} }
_dealGlobalTouchEnd(e) { _dealGlobalTouchEnd(e): boolean {
let interrupt = super._dealGlobalTouchEnd(e); let interrupt = super._dealGlobalTouchEnd(e);
const hitOn = this.hitTest(e); const hitOn = this.hitTest(e);
...@@ -74,7 +74,7 @@ export default class InteractComponent extends ScillaComponent { ...@@ -74,7 +74,7 @@ export default class InteractComponent extends ScillaComponent {
this.isOut = true; this.isOut = true;
return hitOn && interrupt; return hitOn && (interrupt || this.touchInterrupt);
} }
_dealTouchOver(e) { _dealTouchOver(e) {
...@@ -119,7 +119,7 @@ export default class InteractComponent extends ScillaComponent { ...@@ -119,7 +119,7 @@ export default class InteractComponent extends ScillaComponent {
* 碰撞检测 * 碰撞检测
* @param e * @param e
*/ */
hitTest(e) { hitTest(e): boolean {
const matrix = this.transform.getMatrix(false, true); const matrix = this.transform.getMatrix(false, true);
matrix.transformPoint(e.x, e.y, this.localPos); matrix.transformPoint(e.x, e.y, this.localPos);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment