fix: radius algorithm (#37369)

This commit is contained in:
MadCcc 2022-09-02 17:53:57 +08:00 committed by GitHub
parent 46a861afff
commit d519acb3e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -61,7 +61,7 @@ describe('Theme', () => {
12: { radiusBase: 12, radiusLG: 14, radiusSM: 6, radiusXS: 2, radiusOuter: 6 },
14: { radiusBase: 14, radiusLG: 16, radiusSM: 7, radiusXS: 2, radiusOuter: 6 },
16: { radiusBase: 16, radiusLG: 16, radiusSM: 8, radiusXS: 2, radiusOuter: 6 },
20: { radiusBase: 20, radiusLG: 20, radiusSM: 10, radiusXS: 2, radiusOuter: 6 },
20: { radiusBase: 16, radiusLG: 16, radiusSM: 8, radiusXS: 2, radiusOuter: 6 },
};
Object.entries(radiusGroup).forEach(([base, result]) => {

View File

@ -14,7 +14,7 @@ const genRadius = (
} else if (radiusBase < 16 && radiusBase >= 6) {
radiusLG = radiusBase + 2;
} else if (radiusBase >= 16) {
radiusLG = radiusBase;
radiusLG = 16;
}
// radiusSM
@ -27,7 +27,7 @@ const genRadius = (
} else if (radiusBase < 16 && radiusBase >= 14) {
radiusSM = 7;
} else if (radiusBase >= 16) {
radiusSM = radiusBase / 2;
radiusSM = 8;
}
// radiusXS
@ -45,7 +45,7 @@ const genRadius = (
}
return {
radiusBase,
radiusBase: radiusBase > 16 ? 16 : radiusBase,
radiusXS,
radiusSM,
radiusLG,