Leaflet.PixiOverlay icon indicating copy to clipboard operation
Leaflet.PixiOverlay copied to clipboard

PIXI.Graphics - bezierCurveTo or lineTo not clickable

Open titusimaginea opened this issue 3 years ago • 0 comments

Hello, After adding a line or curve using bezierCurveTo or lineTo function of PIXI.Graphics mouse events not triggering on them.

const arc = new PIXI.Graphics();
arc.lineStyle(lineWeight, 0x3388ff);

arc.moveTo(from.x, from.y);
arc.bezierCurveTo(mid.x, mid.y, mid.x, mid.y, to.x, to.y)

arc.interactive = true;

arc.on('click', () => {
    console.log("clicked")
});

arc.buttonMode = true

I tried the following

arc.hitArea = new PIXI.Polygon(arc.currentPath.points);

But its not only making the line clickable but also the fill area, which make sense since the hitArea is a Polygon.


I like to draw a curve and enable click on it (only on the line). I tried the docs and google not able to find any solution. Any help and tips are appreciated.

Thanks.

titusimaginea avatar Jun 01 '21 09:06 titusimaginea