fix(tooltip): when arrowPointAtCenter is true,the arrow not in center

pull/8204/head
Windson97 2025-05-29 09:31:20 +08:00 committed by GitHub
parent aa211fd789
commit 6af5bd7688
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

View File

@ -94,11 +94,18 @@ export default function getPlacements(config: PlacementsConfig) {
},
};
Object.keys(placementMap).forEach(key => {
const centerIndex = key.search(/[A-Z]/);
let pointsKey: Direction = key;
if (centerIndex > 0) {
pointsKey = key.substring(0, centerIndex);
}
placementMap[key] = arrowPointAtCenter
? {
...placementMap[key],
overflow: getOverflowOptions(autoAdjustOverflow),
points: placementMap[pointsKey].points,
targetOffset,
offset: targetOffset,
}
: {
...placements[key],