mirror of
https://github.com/motajs/template.git
synced 2026-11-25 07:24:30 +08:00
fix(08-05): expose MapTileBase.restoreDefaultEvents and use it in toStatic
- MapTileBase.restoreDefaultEvents: protected -> public; declare on ITileBase with jsDoc
- MapLayer.toStatic(keepEvent=false): reset reused static tile via restoreDefaultEvents() instead of loadState({})
This commit is contained in:
1 parent
0d41abdaf6
commit
58def1809d
3 files changed
+7
-2
No files matched your search
@@ -383,7 +383,7 @@ export class MapLayer
|
||||
staticTile.syncTileEvent(tile);
|
||||
} else {
|
||||
// 不保留事件时,将复用的静态图块重置为默认事件
|
||||
staticTile.loadState({});
|
||||
staticTile.restoreDefaultEvents();
|
||||
}
|
||||
this.removeDynamic(tile, tile.x, tile.y);
|
||||
this.forEachHook(hook => hook.onDeleteDynamic?.(tile));
|
||||
|
||||
Reference in new issue
Block a user