From f4105ee7cf5f0a0664529c5db14071d165be7669 Mon Sep 17 00:00:00 2001 From: Angelo Pettinelli Date: Mon, 7 Mar 2022 12:06:13 +0100 Subject: [PATCH 1/2] fixed line border prop --- src/Line.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Line.tsx b/src/Line.tsx index ba2fba3..75b27ba 100644 --- a/src/Line.tsx +++ b/src/Line.tsx @@ -149,6 +149,10 @@ const Line = React.forwardRef(function Line(props, ref) { opacity={shape.opacity} height={shape.height} width={shape.width} + stroke={shape.border.color} + strokeWidth={shape.border.width} + strokeOpacity={shape.border.opacity} + strokeDasharray={shape.border.dashArray} /> ) })} @@ -178,6 +182,12 @@ const defaultProps = { dy: 0, rx: 0, color: 'black', + border: { + color: 'black', + width: 0, + opacity: 1, + dashArray: [], + }, }, selected: {}, }, From 0257ff26fa151d5527dfce8d2e79818cc7ac92bd Mon Sep 17 00:00:00 2001 From: Angelo Pettinelli Date: Tue, 8 Mar 2022 10:25:15 +0100 Subject: [PATCH 2/2] fixed dashArray --- src/Line.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Line.tsx b/src/Line.tsx index 75b27ba..2796abc 100644 --- a/src/Line.tsx +++ b/src/Line.tsx @@ -152,7 +152,7 @@ const Line = React.forwardRef(function Line(props, ref) { stroke={shape.border.color} strokeWidth={shape.border.width} strokeOpacity={shape.border.opacity} - strokeDasharray={shape.border.dashArray} + strokeDasharray={stroke.dashArray.length > 0 ? stroke.dashArray.join(',') : undefined} /> ) })} @@ -184,8 +184,8 @@ const defaultProps = { color: 'black', border: { color: 'black', - width: 0, - opacity: 1, + width: 1, + opacity: 0, dashArray: [], }, },