Select box runs fine with any zoom level and or panning.

This commit is contained in:
mdtrooper 2016-03-29 09:30:20 +02:00
parent 44b7c30ac0
commit 1b7c1efe4b
1 changed files with 8 additions and 6 deletions

View File

@ -1608,15 +1608,17 @@ MapController.prototype.multiple_selection_select_nodes = function() {
var zoom = d3.transform(
d3.select(self._target + " .viewport").attr("transform"));
selection_box_dimensions["x"] = (selection_box_dimensions["x"]
- zoom.translate[0]); // / zoom.scale[0];
selection_box_dimensions["y"] = (selection_box_dimensions["y"]
- zoom.translate[1]); // / zoom.scale[1];
console.log("zoom", zoom);
selection_box_dimensions["x"] = (selection_box_dimensions["x"] / zoom.scale[0]
- zoom.translate[0] / zoom.scale[0]);
selection_box_dimensions["y"] = (selection_box_dimensions["y"] / zoom.scale[1]
- zoom.translate[1] / zoom.scale[1]);
selection_box_dimensions["width"] =
selection_box_dimensions["width"] * zoom.scale[0];
selection_box_dimensions["width"] / zoom.scale[0];
selection_box_dimensions["height"] =
selection_box_dimensions["height"] * zoom.scale[1];
selection_box_dimensions["height"] / zoom.scale[1];
$.each(nodes, function(i, node) {
if (node.type != ITEM_TYPE_AGENT_NETWORKMAP)