mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
introduce RED.view.dimensions for workspace dimensions
This commit is contained in:
parent
02308f9e2f
commit
6c1f63bfbb
@ -105,8 +105,9 @@ RED.view.tools = (function() {
|
||||
$(document).one('keyup',endKeyboardMove);
|
||||
endMoveSet = true;
|
||||
}
|
||||
var space_width = 5000;
|
||||
var space_height = 5000;
|
||||
var dim = RED.view.dimensions();
|
||||
var space_width = dim.width;
|
||||
var space_height = dim.height;
|
||||
var minX = 0;
|
||||
var minY = 0;
|
||||
var node;
|
||||
@ -138,7 +139,6 @@ RED.view.tools = (function() {
|
||||
minY = Math.min(node.n.y-node.n.h/2-5,minY);
|
||||
}
|
||||
}
|
||||
console.log("; mS:", dx, dy, minX, minY);
|
||||
if (minX !== 0 || minY !== 0) {
|
||||
for (var n = 0; n<moving_set.length; n++) {
|
||||
node = moving_set[n];
|
||||
|
@ -6236,6 +6236,12 @@ RED.view = (function() {
|
||||
showQuickAddDialog:showQuickAddDialog,
|
||||
calculateNodeDimensions: calculateNodeDimensions,
|
||||
getElementPosition:getElementPosition,
|
||||
showTooltip:showTooltip
|
||||
showTooltip:showTooltip,
|
||||
dimensions: function() {
|
||||
return {
|
||||
width: space_width,
|
||||
height: space_height
|
||||
};
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user