How to freely draw a Line with a filter applied in Konva

35 views Asked by At

I know that in order to apply a filter in Konva, each element must be cached. I am making an app that draws lines in react konva. I wonder if there is a way to draw a line with a filter applied.

{items.map((line, index) => (
    <Line
        name="object"
        key={index}
        id={line.id}
        x={line.x}
        y={line.y}
        dashEnabled={true}
        points={line.points}
        stroke={line.color}
        strokeWidth={line.width}
        tension={0.5}
        filters={[Konva.Filters.Noise]}
        Noise={1}
        lineCap="round"
        lineJoin="round"
        globalCompositeOperation="source-over"
    />
))}
0

There are 0 answers