Skip to content

Commit

Permalink
after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
LinYunMo committed Sep 25, 2023
1 parent 6814c33 commit 24fa515
Show file tree
Hide file tree
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
Expand Up @@ -24,6 +24,7 @@

import { warn, warnID } from '@base/debug';

Check failure on line 25 in cocos/2d/assembler/label/font-utils.ts

View workflow job for this annotation

GitHub Actions / npm_test

Duplicate identifier 'warn'.

Check failure on line 25 in cocos/2d/assembler/label/font-utils.ts

View workflow job for this annotation

GitHub Actions / npm_test

Duplicate identifier 'warnID'.

Check failure on line 25 in cocos/2d/assembler/label/font-utils.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

'@base/debug' imported multiple times
import { ccwindow } from '@base/global';
import { warn, warnID } from '@base/debug';

Check failure on line 27 in cocos/2d/assembler/label/font-utils.ts

View workflow job for this annotation

GitHub Actions / npm_test

Duplicate identifier 'warn'.

Check failure on line 27 in cocos/2d/assembler/label/font-utils.ts

View workflow job for this annotation

GitHub Actions / npm_test

Duplicate identifier 'warnID'.

Check failure on line 27 in cocos/2d/assembler/label/font-utils.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

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

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

Check failure on line 45 in cocos/2d/assembler/label/letter-font.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe return of an `any` typed value
},

_getFontFamily (comp: Label) {
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion cocos/2d/assembler/label/text-processing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 1 addition & 2 deletions cocos/2d/assembler/label/ttfUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions cocos/2d/components/rich-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Check failure on line 28 in cocos/2d/components/rich-text.ts

View workflow job for this annotation

GitHub Actions / npm_test

Duplicate identifier 'assert'.

Check failure on line 28 in cocos/2d/components/rich-text.ts

View workflow job for this annotation

GitHub Actions / npm_test

Duplicate identifier 'warnID'.
import { cclegacy } from '@base/global';
import { assert, warnID } from '@base/debug';

Check failure on line 30 in cocos/2d/components/rich-text.ts

View workflow job for this annotation

GitHub Actions / npm_test

Duplicate identifier 'assert'.

Check failure on line 30 in cocos/2d/components/rich-text.ts

View workflow job for this annotation

GitHub Actions / npm_test

Duplicate identifier 'warnID'.
import { Font, SpriteAtlas, TTFFont, SpriteFrame } from '../assets';
import { EventTouch } from '../../input/types';
import { Color, Vec2, CCObject, js, Size } from '../../core';
Expand Down

0 comments on commit 24fa515

Please sign in to comment.