Skip to content

Commit

Permalink
Style freehand lines with CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
eatyourgreens committed Jul 12, 2024
1 parent 3991222 commit d9f65c3
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ const GRAB_STROKE_WIDTH = 10
const FINISHER_RADIUS = 4

const StyledGroup = styled.g`
stroke-width: 2px;
stroke-linecap: round;
stroke-linejoin: round;
&:hover {
cursor: pointer;
}
Expand Down Expand Up @@ -74,8 +78,6 @@ function FreehandLine({ active, mark, onFinish, scale }) {
// The model uses this internally
mark.setScale(scale)

const STROKE_WIDTH = 2

function onDoubleClick(event) {
if (active) {
mark.splicePathDragPoint(createPoint(event))
Expand Down Expand Up @@ -118,10 +120,7 @@ function FreehandLine({ active, mark, onFinish, scale }) {
<path // Main Path that's visible
d={pointsToPath(pts)}
fill='none'
strokeWidth={STROKE_WIDTH}
strokeOpacity={1}
strokeLinecap='round'
strokeLinejoin='round'
vectorEffect={'non-scaling-stroke'}
/>
<title>{getHoverText()}</title>
Expand All @@ -140,7 +139,6 @@ function FreehandLine({ active, mark, onFinish, scale }) {
<path // Clipped Path
d={pointsToPath(mark.splicePathRender)}
strokeDasharray='2 2'
strokeWidth={STROKE_WIDTH}
opacity=".4"
vectorEffect={'non-scaling-stroke'}
/>
Expand Down

0 comments on commit d9f65c3

Please sign in to comment.