|
From: <ma...@us...> - 2011-01-15 22:34:33
|
Revision: 249
http://openautomation.svn.sourceforge.net/openautomation/?rev=249&view=rev
Author: mayerch
Date: 2011-01-15 22:34:27 +0000 (Sat, 15 Jan 2011)
Log Message:
-----------
New function that gives the current coordinate based on the event object that is passed as an parameter.
This will be extended later when the zooming functionality gets implemented
Modified Paths:
--------------
PyWireGate/trunk/logic_editor/logicEditor.js
Modified: PyWireGate/trunk/logic_editor/logicEditor.js
===================================================================
--- PyWireGate/trunk/logic_editor/logicEditor.js 2011-01-14 23:50:58 UTC (rev 248)
+++ PyWireGate/trunk/logic_editor/logicEditor.js 2011-01-15 22:34:27 UTC (rev 249)
@@ -158,3 +158,14 @@
});
element.setAttribute( 'class', element.getAttribute( 'class' ) + ' selected' );
}
+
+jQuery(document).ready(function(){
+ var getCoordinate = (function()
+ {
+ var svg = $('#editor svg'); // quasi static variable
+ return function( event ) {
+ var o = svg.offset();
+ return {x: event.pageX - o.left, y: event.pageY - o.top};
+ };
+ })();
+});
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|