Skip to content

Commit

Permalink
after rebase
Browse files Browse the repository at this point in the history
LinYunMo committed Sep 25, 2023
1 parent 6814c33 commit 24fa515
Showing 5 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions cocos/2d/assembler/label/font-utils.ts
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@

import { warn, warnID } from '@base/debug';
import { ccwindow } from '@base/global';
import { warn, warnID } from '@base/debug';
import { FontAtlas } from '../../assets/bitmap-font';
import { Color, macro, ImageData } from '../../../core';
import { ImageAsset, Texture2D } from '../../../asset/assets';
14 changes: 7 additions & 7 deletions cocos/2d/assembler/label/letter-font.ts
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ export const letterFont = js.mixin(bmfontUtils, {
_shareAtlas = new LetterAtlas(_atlasWidth, _atlasHeight);
}

return _shareAtlas.getTexture() as LetterRenderTexture | null;
return _shareAtlas.getTexture();
},

_getFontFamily (comp: Label) {
@@ -89,13 +89,13 @@ export const letterFont = js.mixin(bmfontUtils, {

// outline
let margin = 0;
const outline = comp.getComponent(LabelOutline);
if (outline && outline.enabled) {
const isOutlined = comp.enableOutline && comp.outlineWidth > 0;
if (isOutlined) {
style.isOutlined = true;
margin = outline.width;
style.outlineWidth = outline.width;
style.outlineColor = outline.color.clone();
style.outlineColor.a = outline.color.a * comp.color.a / 255.0;
margin = comp.outlineWidth;
style.outlineWidth = comp.outlineWidth;
style.outlineColor = comp.outlineColor.clone();
style.outlineColor.a = comp.outlineColor.a * comp.color.a / 255.0;
} else {
style.outlineWidth = 0;
style.isOutlined = false;
2 changes: 1 addition & 1 deletion cocos/2d/assembler/label/text-processing.ts
Original file line number Diff line number Diff line change
@@ -741,7 +741,7 @@ export class TextProcessing {
layout: TextLayout,
outputLayoutData: TextOutputLayoutData,
inputString: string,
nextTokenFunc: (arg0: TextStyle, arg1: TextLayout, arg2: string, arg3: number, arg4: number) => number,
nextTokenFunc: (arg0: TextStyle, arg1: TextLayout, arg2: string, arg3: number, arg4: number, arg5: number) => number,
): boolean {
layout.linesWidth.length = 0;

3 changes: 1 addition & 2 deletions cocos/2d/assembler/label/ttfUtils.ts
Original file line number Diff line number Diff line change
@@ -37,11 +37,10 @@ const Overflow = Label.Overflow;

export const ttfUtils = {

updateProcessingData (
updateLayoutProcessingData (
style: TextStyle,
layout: TextLayout,
outputLayoutData: TextOutputLayoutData,
outputRenderData: TextOutputRenderData,
comp: Label,
trans: UITransform,
): void {
1 change: 1 addition & 0 deletions cocos/2d/components/rich-text.ts
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@ import { ccclass, executeInEditMode, executionOrder, help, menu, tooltip, multil
import { DEBUG, DEV, EDITOR } from 'internal:constants';
import { assert, warnID } from '@base/debug';
import { cclegacy } from '@base/global';
import { assert, warnID } from '@base/debug';
import { Font, SpriteAtlas, TTFFont, SpriteFrame } from '../assets';
import { EventTouch } from '../../input/types';
import { Color, Vec2, CCObject, js, Size } from '../../core';

0 comments on commit 24fa515

Please sign in to comment.