Просмотр исходного кода

fix(free-layout): move line.uiState.className and style to parent div (#693)

xiamidaxia 4 месяцев назад
Родитель
Сommit
71a2b4ad78

+ 1 - 3
packages/plugins/free-lines-plugin/src/components/workflow-line-render/index.style.ts

@@ -7,9 +7,7 @@ import styled from 'styled-components';
 
 // 添加一个固定类名,用于选中该节点
 
-export const LineStyle = styled.div.attrs({
-  className: 'gedit-flow-activity-edge',
-})`
+export const LineStyle = styled.div`
   position: absolute;
 
   @keyframes flowingDash {

+ 3 - 5
packages/plugins/free-lines-plugin/src/components/workflow-line-render/line-svg.tsx

@@ -62,17 +62,15 @@ export const LineSVG = (props: LineRenderProps) => {
       fill="none"
       stroke={`url(#${strokeID})`}
       strokeWidth={strokeWidth}
-      style={line.uiState.style}
-      className={clsx(
-        line.className,
-        line.processing || line.flowing ? 'dashed-line flowing-line' : ''
-      )}
+      className={line.processing || line.flowing ? 'dashed-line flowing-line' : ''}
     />
   );
 
   return (
     <LineStyle
+      className={clsx('gedit-flow-activity-edge', line.className)}
       style={{
+        ...line.uiState.style,
         left: bounds.x - PADDING,
         top: bounds.y - PADDING,
         position: 'absolute',