Fix issue 49: take into account scroll offsets with canvas

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@226 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Jeff Schiller 2009-06-29 15:08:40 +00:00
parent 579dac1219
commit 3ab00a7148
1 changed files with 4 additions and 4 deletions

View File

@ -583,8 +583,8 @@ function SvgCanvas(c)
// and do nothing else // and do nothing else
var mouseDown = function(evt) var mouseDown = function(evt)
{ {
var x = evt.pageX - container.parentNode.offsetLeft; var x = evt.pageX - container.parentNode.offsetLeft + container.parentNode.scrollLeft;
var y = evt.pageY - container.parentNode.offsetTop; var y = evt.pageY - container.parentNode.offsetTop + container.parentNode.scrollTop;
switch (current_mode) { switch (current_mode) {
case "select": case "select":
started = true; started = true;
@ -741,8 +741,8 @@ function SvgCanvas(c)
var mouseMove = function(evt) var mouseMove = function(evt)
{ {
if (!started) return; if (!started) return;
var x = evt.pageX - container.parentNode.offsetLeft; var x = evt.pageX - container.parentNode.offsetLeft + container.parentNode.scrollLeft;
var y = evt.pageY - container.parentNode.offsetTop; var y = evt.pageY - container.parentNode.offsetTop + container.parentNode.scrollTop;
var shape = svgdoc.getElementById(getId()); var shape = svgdoc.getElementById(getId());
switch (current_mode) switch (current_mode)
{ {