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