swharden / SWHarden.com

The personal website of Scott W Harden
https://swharden.com
MIT License
4 stars 0 forks source link

IsPointInsideRectangle has an issue with small Axis scale #14

Open swharden opened 10 months ago

swharden commented 10 months ago

from https://github.com/ScottPlot/ScottPlot/discussions/2919

@singfui writes:

// https://swharden.com/blog/2022-02-01-point-in-rectangle/

return difference < .001 * (rect.Height + rect.Width);

This has an issue on small rectangle when either Y and or X axis scale is small. The detection on mouse over element will expanded to a bigger area

image

singfui commented 7 months ago

@swharden hmm I have missed this. This is actually from scott plot. It's the Text Label, I provided your blog as a reference to highlight the delta in the implementation