mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-19 04:19:30 +08:00
fix: 显伤层报错
This commit is contained in:
parent
d535fe82c0
commit
dbae5a7c7d
@ -130,10 +130,8 @@ export class BlockCacher<
|
|||||||
if (deep & (1 << i)) {
|
if (deep & (1 << i)) {
|
||||||
const nowIndex = index * this.cacheDepth + i;
|
const nowIndex = index * this.cacheDepth + i;
|
||||||
const item = this.cache.get(nowIndex);
|
const item = this.cache.get(nowIndex);
|
||||||
if (item) {
|
item?.destroy();
|
||||||
item.destroy();
|
this.cache.delete(nowIndex);
|
||||||
this.cache.delete(nowIndex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -141,12 +139,10 @@ export class BlockCacher<
|
|||||||
/**
|
/**
|
||||||
* 清空指定索引的缓存,与 {@link clearCache} 不同的是,这里会直接清空对应索引的缓存,而不是指定分块的缓存(分块->void)
|
* 清空指定索引的缓存,与 {@link clearCache} 不同的是,这里会直接清空对应索引的缓存,而不是指定分块的缓存(分块->void)
|
||||||
*/
|
*/
|
||||||
clearCacheByIndex(index: number, func: (item: T) => void) {
|
clearCacheByIndex(index: number) {
|
||||||
const item = this.cache.get(index);
|
const item = this.cache.get(index);
|
||||||
if (item) {
|
item?.destroy();
|
||||||
item.destroy();
|
this.cache.delete(index);
|
||||||
this.cache.delete(index);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -503,7 +503,8 @@ export class Damage extends RenderItem<EDamageEvent> {
|
|||||||
this.emit('dirtyUpdate', v);
|
this.emit('dirtyUpdate', v);
|
||||||
|
|
||||||
// 否则依次渲染并写入缓存
|
// 否则依次渲染并写入缓存
|
||||||
const temp = cache?.canvas ?? new MotaOffscreenCanvas2D();
|
const temp =
|
||||||
|
block.cache.get(v)?.canvas ?? new MotaOffscreenCanvas2D();
|
||||||
temp.clear();
|
temp.clear();
|
||||||
temp.setHD(true);
|
temp.setHD(true);
|
||||||
temp.setAntiAliasing(true);
|
temp.setAntiAliasing(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user