mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
perf: delete unnecessary calculations (#54443)
This commit is contained in:
@@ -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':
|
||||
|
||||
Reference in New Issue
Block a user