Fix weighting calculation in the event of dragging nodes.

Fixing error on grid weight calculation when more than one nodes are dragged.