ericabouaf / wireit

A javascript wiring library to create web wirable interfaces for dataflow applications, visual programming languages or graphical modeling.
http://neyric.github.io/wireit/docs/
Other
520 stars 90 forks source link

Wrapping a layer with a div with margin:auto messes up the display of wires when you're dragging them #3

Closed ericabouaf closed 12 years ago

ericabouaf commented 15 years ago
# wrapper { margin:auto; width:800px; } var layer = document.getElementById('layer'); new WireIt.Layer({parentEl:layer}); The above wraps the layer in a div that centres everything. You will note that if you try to drag a wire around, the end of the wire is not connected to your mouse cursor but is displaced by the same distance as the wrapper is moved from the side of the screen. ``` * ``` Comments and changes to this ticket ``` * jgoeth jgoeth July 28th, 2009 @ 12:34 PM I'm facing exactly the above problem. I'm desperatly looking for a workaround. Is there a solution for it? Thanks edit * eric.abouaf (at gmail) eric.abouaf (at gmail) August 10th, 2009 @ 03:14 PM Hi, Ths solution would be to position the editing wire in the layer element. This is handled by WireIt.TerminalProxy (in Terminal.js) I'll have a look at it later... By the way, I'm moving the issue tracker on github (they have one now....) ++ ```
oibutsu commented 13 years ago

My firend bakterix help me and find solution. I use jQuery. In Terminal.js, line 254 this.fakeTerminal.pos = [e.clientX+$(window).scrollLeft(), e.clientY+$(window).scrollTop()]; It helps!