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 endX = obj.width || 0;
const endY = obj.height || 0; const endY = obj.height || 0;
const actualStrokeWidth = obj.strokeWidth ?? 2;
return ( return (
<Arrow <Arrow
ref={shapeRef} ref={shapeRef}
@@ -21,7 +23,7 @@ const ArrowShape = ({ obj, isSelected, onSelect, onUpdate, draggable }: ShapePro
y={startY} y={startY}
points={[0, 0, endX - startX, endY - startY]} points={[0, 0, endX - startX, endY - startY]}
stroke={isSelected ? "#3b82f6" : obj.stroke || "#000000"} stroke={isSelected ? "#3b82f6" : obj.stroke || "#000000"}
strokeWidth={isSelected ? 3 : (obj.strokeWidth ?? 2)} strokeWidth={actualStrokeWidth}
fill={isSelected ? "#3b82f6" : obj.stroke || "#000000"} fill={isSelected ? "#3b82f6" : obj.stroke || "#000000"}
hitStrokeWidth={20} hitStrokeWidth={20}
perfectDrawEnabled={false} perfectDrawEnabled={false}
@@ -13,14 +13,16 @@ const LineShape = ({ obj, isSelected, onSelect, onUpdate, draggable }: ShapeProp
const endX = obj.width || 0; const endX = obj.width || 0;
const endY = obj.height || 0; const endY = obj.height || 0;
const actualStrokeWidth = obj.strokeWidth ?? 2;
return ( return (
<Line <Line
ref={shapeRef} ref={shapeRef}
x={startX} x={startX}
y={startY} y={startY}
points={[0, 0, endX - startX, endY - startY]} points={[0, 0, endX - startX, endY - startY]}
stroke={isSelected ? "#3b82f6" : obj.stroke || "#000000"} stroke={obj.stroke || "#000000"}
strokeWidth={isSelected ? 3 : (obj.strokeWidth ?? 2)} strokeWidth={actualStrokeWidth}
hitStrokeWidth={20} hitStrokeWidth={20}
perfectDrawEnabled={false} perfectDrawEnabled={false}
rotation={obj.rotation || 0} rotation={obj.rotation || 0}