live color line

This commit is contained in:
hamid zarghami
2026-01-08 09:30:50 +03:30
parent ec28c0cc68
commit fcb4bc4f2f
2 changed files with 7 additions and 3 deletions
@@ -13,6 +13,8 @@ const ArrowShape = ({ obj, isSelected, onSelect, onUpdate, draggable }: ShapePro
const endX = obj.width || 0;
const endY = obj.height || 0;
const actualStrokeWidth = obj.strokeWidth ?? 2;
return (
<Arrow
ref={shapeRef}
@@ -21,7 +23,7 @@ const ArrowShape = ({ obj, isSelected, onSelect, onUpdate, draggable }: ShapePro
y={startY}
points={[0, 0, endX - startX, endY - startY]}
stroke={isSelected ? "#3b82f6" : obj.stroke || "#000000"}
strokeWidth={isSelected ? 3 : (obj.strokeWidth ?? 2)}
strokeWidth={actualStrokeWidth}
fill={isSelected ? "#3b82f6" : obj.stroke || "#000000"}
hitStrokeWidth={20}
perfectDrawEnabled={false}
@@ -13,14 +13,16 @@ const LineShape = ({ obj, isSelected, onSelect, onUpdate, draggable }: ShapeProp
const endX = obj.width || 0;
const endY = obj.height || 0;
const actualStrokeWidth = obj.strokeWidth ?? 2;
return (
<Line
ref={shapeRef}
x={startX}
y={startY}
points={[0, 0, endX - startX, endY - startY]}
stroke={isSelected ? "#3b82f6" : obj.stroke || "#000000"}
strokeWidth={isSelected ? 3 : (obj.strokeWidth ?? 2)}
stroke={obj.stroke || "#000000"}
strokeWidth={actualStrokeWidth}
hitStrokeWidth={20}
perfectDrawEnabled={false}
rotation={obj.rotation || 0}