|
From: <ma...@us...> - 2011-01-16 15:39:24
|
Revision: 258
http://openautomation.svn.sourceforge.net/openautomation/?rev=258&view=rev
Author: mayerch
Date: 2011-01-16 15:39:18 +0000 (Sun, 16 Jan 2011)
Log Message:
-----------
* Initial setup of status bar
* Limit zoomlevel to (huge!) 3200%
Modified Paths:
--------------
PyWireGate/trunk/logic_editor/index.html
PyWireGate/trunk/logic_editor/logicEditor.js
Modified: PyWireGate/trunk/logic_editor/index.html
===================================================================
--- PyWireGate/trunk/logic_editor/index.html 2011-01-16 15:10:41 UTC (rev 257)
+++ PyWireGate/trunk/logic_editor/index.html 2011-01-16 15:39:18 UTC (rev 258)
@@ -33,5 +33,8 @@
<h2>Element Library</h2>
<div id="library"></div>
</div>
+ <div id="status" class="ui-layout-south">
+ <div id="zoom">Zoom: <span id="zoomLevel">100%</span></div>
+ </div>
</body>
</html>
Modified: PyWireGate/trunk/logic_editor/logicEditor.js
===================================================================
--- PyWireGate/trunk/logic_editor/logicEditor.js 2011-01-16 15:10:41 UTC (rev 257)
+++ PyWireGate/trunk/logic_editor/logicEditor.js 2011-01-16 15:39:18 UTC (rev 258)
@@ -32,8 +32,10 @@
editor.width.baseVal.value = Math.max( maxX, state.innerWidth );
editor.height.baseVal.value = Math.max( maxY, state.innerHeight );
},
- north__closable: false,
- north__resizable: false
+ north__closable : false,
+ north__resizable: false,
+ south__closable : false,
+ south__resizable: false
});
$('#structureTree').jstree({
plugins : [ 'json_data', 'themes', 'types' ],
@@ -215,11 +217,14 @@
zoomLevel = level;
else
zoomLevel -= level;
+ zoomLevel = zoomLevel < 0 ? 0 : zoomLevel; // limit to huge 3200%
+
var editor = $('#editor'); // quasi static variable
var svg = $('#editor svg')[0];
var x = Math.max( maxX, editor.innerWidth() );
var y = Math.max( maxY, editor.innerHeight() );
- var factor = Math.pow(Math.sqrt(2),10-zoomLevel);// Math.log(-10+zoomLevel) / Math.log( 2 );
+ var factor = Math.pow(Math.sqrt(2),10-zoomLevel);
+ $('#zoomLevel').html( (100*factor).toFixed() + '%' );
if( zoomLevel < 10 )
{
svg.width.baseVal.value = x* factor;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|