mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2025-04-12 06:51:01 +00:00
fix the hash value for the label outline opacity is not being calculated correctly.
This commit is contained in:
parent
5277bb6fca
commit
44c9d02eab
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user