Commit 215bc29d authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fix a bug in convertToRelativePosition.

parent f1119eeb
......@@ -176,10 +176,17 @@
that.convertToRelativePosition = function (x, y) {
var canvas_size_x = $('#main').width();
var canvas_size_y = $('#main').height();
var size_x = $('.window').width();
var size_y = $('.window').height();
var node_style = priv.preference_container['node_style'];
var size_x, size_y;
if (node_style === undefined) {
size_x = $('.window').width();
size_y = $('.window').height();
} else {
size_x = node_style['width'].replace('px', '');
size_y = node_style['height'].replace('px', '');
}
var top = y.replace('px', '') / (canvas_size_y - size_y);
var left = x.replace('px', '') / (canvas_size_y - size_y);
var left = x.replace('px', '') / (canvas_size_x - size_x);
return [left, top];
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment