mirror of https://github.com/node-red/node-red.git
don't pin new nodes to grid if not using grid
parent
766ccf85c2
commit
1d1ab5b7b2
|
@ -703,8 +703,14 @@ RED.view = (function() {
|
|||
}
|
||||
var nn = result.node;
|
||||
var historyEvent = result.historyEvent;
|
||||
nn.x = Math.ceil((point[0] - 50) / gridSize) * gridSize + 50;
|
||||
nn.y = parseInt(point[1] / gridSize) * gridSize;
|
||||
if (RED.settings.get("editor").view['view-snap-grid']) {
|
||||
nn.x = Math.ceil((point[0] - 50) / gridSize) * gridSize + 50;
|
||||
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");
|
||||
if (showLabel !== undefined && !/^link (in|out)$/.test(nn._def.type) && !nn._def.defaults.hasOwnProperty("l")) {
|
||||
|
|
Loading…
Reference in New Issue