don't pin new nodes to grid if not using grid

pull/2033/head
Dave Conway-Jones 2019-01-21 16:15:38 +00:00
parent 766ccf85c2
commit 1d1ab5b7b2
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4
1 changed files with 8 additions and 2 deletions

View File

@ -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")) {