Record coordinate changes in block representation

This commit is contained in:
Tim Mickel 2016-08-31 11:34:29 -04:00
parent 05a5369d7b
commit c58bda1839

View file

@ -212,6 +212,12 @@ Blocks.prototype.changeBlock = function (args) {
* @param {!Object} e Blockly move event to be processed * @param {!Object} e Blockly move event to be processed
*/ */
Blocks.prototype.moveBlock = function (e) { Blocks.prototype.moveBlock = function (e) {
// Move coordinate changes.
if (e.newCoordinate) {
this._blocks[e.id].x = e.newCoordinate.x;
this._blocks[e.id].y = e.newCoordinate.y;
}
// Remove from any old parent. // Remove from any old parent.
if (e.oldParent !== undefined) { if (e.oldParent !== undefined) {
var oldParent = this._blocks[e.oldParent]; var oldParent = this._blocks[e.oldParent];