Click here to Skip to main content
15,666,947 members
Please Sign up or sign in to vote.
0.00/5 (No votes)

I am developing a Building Plan Drawing Application in HTML5.
For that I needed to place the doors and windows on walls.
Usually, the walls (lines) are not straight.
How can I find if my mouse has touched the walls (lines) while moving the door Image.
Moreover, I should find the X, Y and angle of the door to be drawn.
Please help...

1 solution

This is called "hit testing".

This is a working JSFiddle sample of the solution:[^].

See also:[^],[^],[^].

You can find some more demonstrations is you do something like this:[^].

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900