3

I've drawn a GeneralPath that represents a mean on a chart. Now what i need is detecting when the mouse is near it: i've used Line2d.segDist to detect if the mouse is near a Line2D object. Is there something similar for GeneralPath?

lbalazscs
  • 17,474
  • 7
  • 42
  • 50
mark
  • 939
  • 2
  • 13
  • 36

1 Answers1

3

Using Stroke.createStrokedShape you can detect it for every Path2D object in a generic way (GeneralPath is a subclass of Path2D), see my answer for a similar question here: Mouse pointer detection over a Path2D

Community
  • 1
  • 1
lbalazscs
  • 17,474
  • 7
  • 42
  • 50