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": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": -176.293, "x": -233.245,
"y": 120.83, "y": 120.83,
"z": 0 "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 { private _normalizeProgress(progress: number): number {
if (!Number.isFinite(progress)) { if (!Number.isFinite(progress) || progress <= 0) {
return 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, "_fillStart": 0,
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": false,
"_useGrayscale": false, "_useGrayscale": false,
"_atlas": null, "_atlas": null,
"_id": "" "_id": ""

View File

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