fix the hash value for the label outline opacity is not being calculated correctly.

This commit is contained in:
段旭东 2025-01-08 20:43:57 +08:00 committed by SmallMain
parent 5277bb6fca
commit 44c9d02eab
2 changed files with 10 additions and 10 deletions

View File

@ -459,8 +459,8 @@ class LetterAtlases {
fontDesc: labelInfo.fontDesc,
fontSize: labelInfo.fontSize,
margin: labelInfo.margin,
out: labelInfo.out.toHEX(),
color: labelInfo.color.toHEX(),
out: labelInfo.out.toHEX('#rrggbbaa'),
color: labelInfo.color.toHEX('#rrggbbaa'),
isOutlined: labelInfo.isOutlined,
};
Label._canvasPool.put(canvas);
@ -549,10 +549,10 @@ class LetterAtlases {
function computeHash (labelInfo) {
let hashData = '|';
let color = labelInfo.color.toHEX();
let color = labelInfo.color.toHEX('#rrggbbaa');
let out = '';
if (labelInfo.isOutlined && labelInfo.margin > 0) {
out = out + labelInfo.margin + labelInfo.out.toHEX();
out = out + labelInfo.margin + labelInfo.out.toHEX('#rrggbbaa');
}
return hashData + labelInfo.fontSize + labelInfo.fontFamily + color + out;

View File

@ -101,7 +101,7 @@ export default class TTFAssembler extends Assembler2D {
updateRenderData (comp) {
super.updateRenderData(comp);
if (!comp._vertsDirty) return false;
this._updateProperties(comp);
@ -297,7 +297,7 @@ export default class TTFAssembler extends Assembler2D {
if (_shadowComp) {
this._setupShadow();
}
if (_outlineComp) {
this._setupOutline();
}
@ -387,19 +387,19 @@ export default class TTFAssembler extends Assembler2D {
frame._texture._uuid = _fontDesc
+ _overflow
+ (_premultiply ? 'P' : 'NP')
+ comp.node.color.toHEX()
+ comp.node.color.toHEX('#rrggbbaa')
+ (_enableUnderline ? 'UL' : 'NUL')
+ _string;
if (_outlineComp) {
frame._texture._uuid += _outlineComp.color.toHEX()
frame._texture._uuid += _outlineComp.color.toHEX('#rrggbbaa')
+ ','
+ _outlineComp.width
+ ',';
}
if (_shadowComp) {
frame._texture._uuid += _shadowComp.color.toHEX()
frame._texture._uuid += _shadowComp.color.toHEX('#rrggbbaa')
+ _shadowComp.offset.x
+ ','
+ _shadowComp.offset.y
@ -476,7 +476,7 @@ export default class TTFAssembler extends Assembler2D {
_calculateShrinkFont (paragraphedStrings) {
let paragraphLength = this._calculateParagraphLength(paragraphedStrings, _context);
let i = 0;
let totalHeight = 0;
let maxLength = 0;