mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 13:17:32 +00:00
fix: 能量进度条满问题
This commit is contained in:
parent
1c65f10e24
commit
ac96925c70
3 changed files with 6 additions and 3 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,3 +1,6 @@
|
|||
*.css.map
|
||||
config/**/*.*
|
||||
!config/.gitkeep
|
||||
|
||||
.DS_Store
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ function render(e, renderPath, renderData = {}, cfg = {}) {
|
|||
// 获取渲染精度配置
|
||||
const scaleCfg = setting.getConfig('config')?.render?.scale || 100;
|
||||
// 计算配置缩放比例
|
||||
const scaleCfgValue = Math.min(2, Math.max(0.5, scaleCfg / 100));
|
||||
const scaleCfgValue = Math.min(2, Math.max(0.5, scaleCfg / 100)) * 2;
|
||||
// 将函数参数中的缩放比例与配置缩放比例相乘
|
||||
const scale = (cfg?.scale || 1) * scaleCfgValue;
|
||||
// 将缩放比例转换为style属性
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ export class EnergyProgress {
|
|||
constructor(max, current) {
|
||||
this.max = max;
|
||||
this.current = current;
|
||||
this.percent = parseInt((Number(current) / Number(max)) * 100);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -64,11 +65,10 @@ export class Energy {
|
|||
* @param {number} restore
|
||||
*/
|
||||
constructor(progress, restore) {
|
||||
this.progress = progress;
|
||||
this.progress = new EnergyProgress(progress.max, progress.current);
|
||||
this.restore = restore;
|
||||
const leftHM = converSecondsToHM(restore);
|
||||
this.progress.rest = `${leftHM[0]}小时${leftHM[1]}分钟`;
|
||||
this.percent = parseInt((progress.current / progress.max) * 100);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue