mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-12 07:45:41 -05:00
Record coordinate changes in block representation
This commit is contained in:
parent
05a5369d7b
commit
c58bda1839
1 changed files with 6 additions and 0 deletions
|
@ -212,6 +212,12 @@ Blocks.prototype.changeBlock = function (args) {
|
|||
* @param {!Object} e Blockly move event to be processed
|
||||
*/
|
||||
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.
|
||||
if (e.oldParent !== undefined) {
|
||||
var oldParent = this._blocks[e.oldParent];
|
||||
|
|
Loading…
Reference in a new issue