perf: delete unnecessary calculations (#54443)

This commit is contained in:
遇见同学
2025-07-22 22:29:55 +08:00
committed by GitHub
parent 3abd63c432
commit a23b2c082f

View File

@@ -152,6 +152,12 @@ export default function getPlacements(config: PlacementsConfig) {
const placementMap: BuildInPlacements = {};
// Dynamic offset
const arrowOffset = getArrowOffsetToken({
contentRadius: borderRadius,
limitVerticalRadius: true,
});
Object.keys(PlacementAlignMap).forEach((key: PlacementType) => {
const template =
(arrowPointAtCenter && ArrowCenterPlacementAlignMap[key]) || PlacementAlignMap[key];
@@ -195,12 +201,6 @@ export default function getPlacements(config: PlacementsConfig) {
break;
}
// Dynamic offset
const arrowOffset = getArrowOffsetToken({
contentRadius: borderRadius,
limitVerticalRadius: true,
});
if (arrowPointAtCenter) {
switch (key) {
case 'topLeft':