chartjs / chartjs-plugin-annotation

Annotation plugin for Chart.js
MIT License
607 stars 328 forks source link

Polygon: change event tests to inRange tests #651

Closed stockiNail closed 2 years ago

stockiNail commented 2 years ago

This PR remove events test cases with inRange method tests.

it also adds a further check in inRange of polygon because if the radius is set to zero, the point (element.x, element.y) is accepted.

The approach for polygon is a little bit different comparing with point because the polygon is calculating the point elements (used in inRange) at initialization of the element.