From 40b7aaf991c8180ff5a3972a20096ee1fbd6bc23 Mon Sep 17 00:00:00 2001 From: MadCcc <1075746765@qq.com> Date: Wed, 19 Apr 2023 15:53:42 +0800 Subject: [PATCH] fix: arrow compatible (#41872) --- components/style/roundedArrow.ts | 11 ++++++++++- package.json | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/components/style/roundedArrow.ts b/components/style/roundedArrow.ts index e8ce0aa15e..123b3d8cba 100644 --- a/components/style/roundedArrow.ts +++ b/components/style/roundedArrow.ts @@ -24,6 +24,7 @@ export const roundedArrow = ( const fy = ay; const shadowWidth = unitWidth * Math.sqrt(2) + outerRadius * (Math.sqrt(2) - 2); + const polygonOffset = outerRadius * (Math.sqrt(2) - 1); return { pointerEvents: 'none', @@ -38,7 +39,15 @@ export const roundedArrow = ( width, height: width / 2, background: bgColor, - clipPath: `path('M ${ax} ${ay} A ${outerRadius} ${outerRadius} 0 0 0 ${bx} ${by} L ${cx} ${cy} A ${innerRadius} ${innerRadius} 0 0 1 ${dx} ${dy} L ${ex} ${ey} A ${outerRadius} ${outerRadius} 0 0 0 ${fx} ${fy} Z')`, + clipPath: { + _multi_value_: true, + value: [ + `polygon(${polygonOffset}px 100%, 50% ${polygonOffset}px, ${ + 2 * unitWidth - polygonOffset + }px 100%, ${polygonOffset}px 100%)`, + `path('M ${ax} ${ay} A ${outerRadius} ${outerRadius} 0 0 0 ${bx} ${by} L ${cx} ${cy} A ${innerRadius} ${innerRadius} 0 0 1 ${dx} ${dy} L ${ex} ${ey} A ${outerRadius} ${outerRadius} 0 0 0 ${fx} ${fy} Z')`, + ], + }, content: '""', }, diff --git a/package.json b/package.json index a7908bab62..2ffc941af1 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ ], "dependencies": { "@ant-design/colors": "^7.0.0", - "@ant-design/cssinjs": "^1.7.1", + "@ant-design/cssinjs": "^1.9.0", "@ant-design/icons": "^5.0.0", "@ant-design/react-slick": "~1.0.0", "@babel/runtime": "^7.18.3",