Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
add canPass interface in IMap for check a point could pass in map.
stop event in Menu/MenuDown and D5List,when tap those items,touch event will stop immediatetly
  • Loading branch information
D5CN committed Aug 31, 2022
1 parent b0f9b2b commit 2e954bf
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion D5/package.json
@@ -1,4 +1,4 @@
{
"name": "egret",
"version": "5.2.3"
"version": "5.4.1"
}
4 changes: 4 additions & 0 deletions D5/src/com/d5power/core/BaseMap.ts
Expand Up @@ -332,6 +332,10 @@ module d5power
}
}

public canPass(px: number, py: number): boolean {
return true;
}

public get width():number {
return this._mapWidth;
}
Expand Down
6 changes: 6 additions & 0 deletions D5/src/com/d5power/core/IMap.ts
Expand Up @@ -12,5 +12,11 @@ module d5power
getScreenPostion(wx:number,wy:number):egret.Point;
render();
setContainer(container:egret.DisplayObjectContainer);
/**
* 地图上某点是否可以通过
* @param px 地图上的像素坐标x
* @param py 地图上的像素坐标y
*/
canPass(px:number,py:number):boolean;
}
}
1 change: 1 addition & 0 deletions D5BitmapUI/src/D5List.ts
Expand Up @@ -251,6 +251,7 @@ module d5power{

}
private onClick(e:egret.TouchEvent):void{
e.stopImmediatePropagation();
if(e.stageX!=this._beginX || e.stageY!=this._beginY) return;

var t:egret.DisplayObject = this.getUnderMouse(e.stageX,e.stageY);
Expand Down
1 change: 1 addition & 0 deletions D5BitmapUI/src/comps/Menu.ts
Expand Up @@ -145,6 +145,7 @@ namespace d5power

private onDownMenu(e:egret.TouchEvent):void
{
e.stopImmediatePropagation();
var target:D5Button = e.currentTarget as D5Button;
if(this._downMenu)
{
Expand Down
2 changes: 2 additions & 0 deletions D5BitmapUI/src/comps/MenuDown.ts
Expand Up @@ -65,6 +65,7 @@ namespace d5power

private onStageDown(e:egret.TouchEvent):void
{
e.stopImmediatePropagation();
if(!this.hitTestPoint(e.stageX,e.stageY,true))
{
this.hidden();
Expand Down Expand Up @@ -182,6 +183,7 @@ namespace d5power

private onClick(e:Event):void
{
e.stopImmediatePropagation();
if(this._list.value instanceof Function)
{
try
Expand Down

0 comments on commit 2e954bf

Please sign in to comment.