feat: 浏览地图

This commit is contained in:
AncTe committed 2025-08-19 15:06:34 +08:00
1 parent 398de70fee
commit 574d765c69
15 files changed
+615 -35

No files matched your search

-1
View File
@@ -101,7 +101,6 @@ export class MotaOffscreenCanvas2D extends EventEmitter<OffscreenCanvasEvent> {
/**
* 复制一个离屏Canvas2D对象,一般用于缓存等操作
* @param canvas 被复制的MotaOffscreenCanvas2D对象
* @returns 复制结果,注意复制结果是被冻结的,无法进行大小等的修改,但是可以继续绘制
*/
static clone(canvas: MotaOffscreenCanvas2D): MotaOffscreenCanvas2D {
const newCanvas = new MotaOffscreenCanvas2D();
+1 -1
View File
@@ -140,7 +140,7 @@ export class Container<E extends EContainerEvent = EContainerEvent>
destroy(): void {
super.destroy();
this.children.forEach(v => {
v.remove();
v.destroy();
});
}
}
+8 -2
View File
@@ -193,6 +193,8 @@ export class MotaRenderer extends Container implements IRenderTreeRoot {
this.createTouchAction(ev, ActionType.Up).forEach(v => {
this.captureEvent(ActionType.Up, v);
this.captureEvent(ActionType.Click, v);
});
[...ev.touches].forEach(v => {
this.touchInfo.delete(v.identifier);
});
});
@@ -200,14 +202,18 @@ export class MotaRenderer extends Container implements IRenderTreeRoot {
ev.preventDefault();
this.createTouchAction(ev, ActionType.Up).forEach(v => {
this.captureEvent(ActionType.Up, v);
});
[...ev.touches].forEach(v => {
this.touchInfo.delete(v.identifier);
});
});
document.addEventListener('touchmove', ev => {
ev.preventDefault();
this.createTouchAction(ev, ActionType.Move).forEach(v => {
const touch = this.touchInfo.get(v.identifier);
if (!touch) return;
const list = this.touchInfo.values();
if (!list.some(vv => v.identifier === vv.identifier)) {
return;
}
const temp = this.beforeHovered;
temp.clear();
this.beforeHovered = this.hoveredElement;