rebootcode / svg-edit

Automatically exported from code.google.com/p/svg-edit
MIT License
0 stars 0 forks source link

Mouse offset when page scrollbar is not at 0 #867

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open 
https://svg-edit.googlecode.com/svn-history/r2048/trunk/editor/svg-editor.html
2. Resize the browser window, such that the page scrollbars appear.
3. Draw something.

What is the expected output? What do you see instead?

The drawed object should appear where clicked with the mouse pointer. Instead 
there is an offset (see attached screenshot). Both vertical and horizontal 
scrollbars affect the drawing position.

In what browser did you experience this problem? (ALL, Firefox, Opera, etc)
Reproduced with Firefox 7.0.1 and Chrome 14 on Linux and with IE 9.0.3 on 
Windows 7.

In what version of SVG-edit does the problem occur? (Latest trunk, 2.5.1,
etc)
Latest trunk.

Please provide any additional information below.

I propose to use clientX/clientY instead of pageX/pageY (see patch), which 
fixes the issue.

Original issue reported on code.google.com by drh...@gmail.com on 18 Oct 2011 at 11:58

Attachments:

GoogleCodeExporter commented 9 years ago
Good catch - I can reproduce on both FF and IE (Windows).

Original comment by adrianbj...@gmail.com on 18 Oct 2011 at 1:35