Commit 66264c8b authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

nodes should be placed withing the graph editor area.

parent 09cd3dcb
......@@ -87,6 +87,7 @@ li { margin: 3px;
#render {
text-align: center;
background-color:white;
position: relative;
}
#render ul {
......
......@@ -210,6 +210,7 @@
dream_instance = Dream(configuration);
dream_instance.start();
$(".tool").draggable({
containment: '#render',
opacity: 0.7,
helper: "clone",
cursorAt: {
......
......@@ -191,8 +191,8 @@
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_x - size_x);
var top = Math.max(Math.min(y.replace('px', '') / (canvas_size_y - size_y), 1), 0);
var left = Math.max(Math.min(x.replace('px', '') / (canvas_size_x - size_x), 1), 0);
return [left, top];
};
......@@ -212,6 +212,7 @@
};
jsPlumb.draggable(jsPlumb.getSelector(".window"), {
containment: 'parent',
grid: [10, 10],
stop: stop
});
......
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