mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
fix label auto Atlas bug (#15356)
This commit is contained in:
@@ -122,6 +122,7 @@ export const ttfUtils = {
|
||||
// use canvas in assemblerData // to do to optimize
|
||||
processing.setCanvasUsed(comp.assemblerData!.canvas, comp.assemblerData!.context);
|
||||
style.fontFamily = this._updateFontFamily(comp);
|
||||
this._resetDynamicAtlas(comp);
|
||||
|
||||
// TextProcessing
|
||||
processing.processingString(false, style, layout, outputLayoutData, comp.string);
|
||||
@@ -197,4 +198,11 @@ export const ttfUtils = {
|
||||
dynamicAtlasManager.packToDynamicAtlas(comp, frame);
|
||||
// TODO update material and uv
|
||||
},
|
||||
|
||||
_resetDynamicAtlas (comp: Label) {
|
||||
if (comp.cacheMode !== Label.CacheMode.BITMAP) return;
|
||||
const frame = comp.ttfSpriteFrame!;
|
||||
dynamicAtlasManager.deleteAtlasSpriteFrame(frame);
|
||||
frame._resetDynamicAtlasFrame();
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user