search

Home  >  Q&A  >  body text

javascript - How to determine if a point is in a closed path in svg?

How to determine whether a point is in a closed path of svg?

How to know the coordinates of a point on a web page to know whether the point is within a closed area of ​​an irregular path in the entire page

大家讲道理大家讲道理2716 days ago964

reply all(2)I'll reply

  • 習慣沉默

    習慣沉默2017-06-26 10:55:59

    Can it be calculated based on the coordinates of the point and the coordinates of the svg?

    reply
    0
  • 滿天的星座

    滿天的星座2017-06-26 10:55:59

    You need to map the global coordinates of the points to the relative coordinates of the svg, then turn the svg polygon into a set of points, and then use a method similar to this to make a judgment: https://github.com/substack/p...

    reply
    0
  • Cancelreply