perf: 优化 UI

This commit is contained in:
richarjiang
2026-04-26 17:18:25 +08:00
parent 1e5017e28e
commit 9d60fa601d
4 changed files with 32 additions and 29 deletions

View File

@@ -980,7 +980,7 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -176.293,
"x": -233.245,
"y": 120.83,
"z": 0
},

View File

@@ -195,13 +195,16 @@ export class PassModal extends BaseModal {
/**
* 规范化进度值
* 九宫格 Bar 的 Left+Right border = 240pxtotalLength = 925px
* 当 width < 240px 时圆角会畸变,因此 progress > 0 时强制最小值
*/
private _normalizeProgress(progress: number): number {
if (!Number.isFinite(progress)) {
if (!Number.isFinite(progress) || progress <= 0) {
return 0;
}
return Math.max(0, Math.min(1, progress));
const MIN_PROGRESS = 240 / 925;
return Math.max(MIN_PROGRESS, Math.min(1, progress));
}
/**

View File

@@ -2007,7 +2007,7 @@
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_isTrimmedMode": false,
"_useGrayscale": false,
"_atlas": null,
"_id": ""

View File

@@ -41,12 +41,12 @@
"userData": {
"trimThreshold": 1,
"rotated": false,
"offsetX": -1,
"offsetY": 0.5,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 664,
"height": 234,
"width": 666,
"height": 235,
"rawWidth": 666,
"rawHeight": 235,
"borderTop": 0,
@@ -60,17 +60,17 @@
"meshType": 0,
"vertices": {
"rawPosition": [
-332,
-117,
-333,
-117.5,
0,
332,
-117,
333,
-117.5,
0,
-332,
117,
-333,
117.5,
0,
332,
117,
333,
117.5,
0
],
"indexes": [
@@ -84,38 +84,38 @@
"uv": [
0,
235,
664,
666,
235,
0,
1,
664,
1
0,
666,
0
],
"nuv": [
0,
0.00425531914893617,
0.996996996996997,
0.00425531914893617,
0,
1,
0.996996996996997,
0,
0,
1,
1,
1
],
"minPos": [
-332,
-117,
-333,
-117.5,
0
],
"maxPos": [
332,
117,
333,
117.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "f87d228a-c520-499a-bf3a-e66cbb6def64@6c48a",
"atlasUuid": "",
"trimType": "auto"
"trimType": "none"
},
"ver": "1.0.12",
"imported": true,