Skip to content

Commit

Permalink
don't even try to grow pants blocks up
Browse files Browse the repository at this point in the history
  • Loading branch information
rachel-fenichel committed Apr 6, 2016
1 parent 5780d3c commit 237a291
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions core/block_svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -853,15 +853,6 @@ Blockly.BlockSvg.prototype.updatePreviews = function(closestConnection,
if (Blockly.highlightedConnection_ &&
Blockly.highlightedConnection_ != closestConnection) {
if (this.ghostBlock_ && Blockly.localGhostConnection_) {
// If we're connecting inside a pants block and that pants block is at the
// beginning of the stack, it may have grown. We made it look like it
// grew up instead of down, but now we have to undo that.
var closestSource = Blockly.localGhostConnection_.targetBlock();
if (closestSource && Blockly.highlightedConnection_ ==
closestSource.getFirstStatementConnection() &&
!closestSource.previousConnection.targetConnection) {
closestSource.moveBy(0, Blockly.BlockSvg.STATEMENT_BLOCK_SPACE);
}
this.disconnectGhost();
}
Blockly.highlightedConnection_ = null;
Expand Down Expand Up @@ -904,18 +895,6 @@ Blockly.BlockSvg.prototype.updatePreviews = function(closestConnection,

ghostBlock.moveBy(newX - ghostPosition.x, newY - ghostPosition.y);

} else {
var closestSource = closestConnection.sourceBlock_;
if (closestSource && closestConnection ==
closestSource.getFirstStatementConnection() &&
!closestSource.previousConnection.targetConnection) {
// If we're connecting inside a pants block and that pants block is at
// the beginning of the stack, it may have grown. We need to make it
// look like it grew up instead of down.
var yOffset = ghostBlock.getHeightWidth().height -
Blockly.BlockSvg.MIN_BLOCK_Y;
closestSource.moveBy(0, - Blockly.BlockSvg.STATEMENT_BLOCK_SPACE);
}
}
if (localGhostConnection.type == Blockly.PREVIOUS_STATEMENT &&
!ghostBlock.nextConnection) {
Expand Down

0 comments on commit 237a291

Please sign in to comment.