mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
don't pin new nodes to grid if not using grid
This commit is contained in:
parent
766ccf85c2
commit
1d1ab5b7b2
@ -703,8 +703,14 @@ RED.view = (function() {
|
|||||||
}
|
}
|
||||||
var nn = result.node;
|
var nn = result.node;
|
||||||
var historyEvent = result.historyEvent;
|
var historyEvent = result.historyEvent;
|
||||||
|
if (RED.settings.get("editor").view['view-snap-grid']) {
|
||||||
nn.x = Math.ceil((point[0] - 50) / gridSize) * gridSize + 50;
|
nn.x = Math.ceil((point[0] - 50) / gridSize) * gridSize + 50;
|
||||||
nn.y = parseInt(point[1] / gridSize) * gridSize;
|
nn.y = parseInt(point[1] / gridSize) * gridSize;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
nn.x = point[0];
|
||||||
|
nn.y = point[1];
|
||||||
|
}
|
||||||
|
|
||||||
var showLabel = RED.utils.getMessageProperty(RED.settings.get('editor'),"view.view-node-show-label");
|
var showLabel = RED.utils.getMessageProperty(RED.settings.get('editor'),"view.view-node-show-label");
|
||||||
if (showLabel !== undefined && !/^link (in|out)$/.test(nn._def.type) && !nn._def.defaults.hasOwnProperty("l")) {
|
if (showLabel !== undefined && !/^link (in|out)$/.test(nn._def.type) && !nn._def.defaults.hasOwnProperty("l")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user