mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2025-04-21 08:28:40 +00:00
fix the hash value for the label outline opacity is not being calculated correctly.
This commit is contained in:
parent
5277bb6fca
commit
e1c2158287
@ -459,8 +459,8 @@ class LetterAtlases {
|
|||||||
fontDesc: labelInfo.fontDesc,
|
fontDesc: labelInfo.fontDesc,
|
||||||
fontSize: labelInfo.fontSize,
|
fontSize: labelInfo.fontSize,
|
||||||
margin: labelInfo.margin,
|
margin: labelInfo.margin,
|
||||||
out: labelInfo.out.toHEX(),
|
out: labelInfo.out.toHEX('#rrggbbaa'),
|
||||||
color: labelInfo.color.toHEX(),
|
color: labelInfo.color.toHEX('#rrggbbaa'),
|
||||||
isOutlined: labelInfo.isOutlined,
|
isOutlined: labelInfo.isOutlined,
|
||||||
};
|
};
|
||||||
Label._canvasPool.put(canvas);
|
Label._canvasPool.put(canvas);
|
||||||
@ -549,10 +549,10 @@ class LetterAtlases {
|
|||||||
|
|
||||||
function computeHash (labelInfo) {
|
function computeHash (labelInfo) {
|
||||||
let hashData = '|';
|
let hashData = '|';
|
||||||
let color = labelInfo.color.toHEX();
|
let color = labelInfo.color.toHEX('#rrggbbaa');
|
||||||
let out = '';
|
let out = '';
|
||||||
if (labelInfo.isOutlined && labelInfo.margin > 0) {
|
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;
|
return hashData + labelInfo.fontSize + labelInfo.fontFamily + color + out;
|
||||||
|
@ -387,19 +387,19 @@ export default class TTFAssembler extends Assembler2D {
|
|||||||
frame._texture._uuid = _fontDesc
|
frame._texture._uuid = _fontDesc
|
||||||
+ _overflow
|
+ _overflow
|
||||||
+ (_premultiply ? 'P' : 'NP')
|
+ (_premultiply ? 'P' : 'NP')
|
||||||
+ comp.node.color.toHEX()
|
+ comp.node.color.toHEX('#rrggbbaa')
|
||||||
+ (_enableUnderline ? 'UL' : 'NUL')
|
+ (_enableUnderline ? 'UL' : 'NUL')
|
||||||
+ _string;
|
+ _string;
|
||||||
|
|
||||||
if (_outlineComp) {
|
if (_outlineComp) {
|
||||||
frame._texture._uuid += _outlineComp.color.toHEX()
|
frame._texture._uuid += _outlineComp.color.toHEX('#rrggbbaa')
|
||||||
+ ','
|
+ ','
|
||||||
+ _outlineComp.width
|
+ _outlineComp.width
|
||||||
+ ',';
|
+ ',';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_shadowComp) {
|
if (_shadowComp) {
|
||||||
frame._texture._uuid += _shadowComp.color.toHEX()
|
frame._texture._uuid += _shadowComp.color.toHEX('#rrggbbaa')
|
||||||
+ _shadowComp.offset.x
|
+ _shadowComp.offset.x
|
||||||
+ ','
|
+ ','
|
||||||
+ _shadowComp.offset.y
|
+ _shadowComp.offset.y
|
||||||
|
Loading…
x
Reference in New Issue
Block a user