Skip to content

Don't consider ghosts when looking for the closest connection. #125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a67f841
Replace the call to getBBox() in getMainWorkspaceMetrics
picklesrus Feb 29, 2016
23df476
fix test
rachel-fenichel Mar 11, 2016
f978826
Require ConnectionDB where needed; recompile
rachel-fenichel Mar 10, 2016
5097517
Fix search for closest
rachel-fenichel Mar 11, 2016
ff7629f
Merge pull request #282 from rachel-fenichel/bugfix/connection_logic
NeilFraser Mar 11, 2016
580ff24
Merge pull request #280 from rachel-fenichel/bugfix/fix_requires
NeilFraser Mar 11, 2016
06ff90b
Merge pull request #274 from picklesrus/bbox-develop
NeilFraser Mar 11, 2016
4ae3459
Don't connect a block with no next connection if that would force a b…
rachel-fenichel Mar 12, 2016
74ea1f1
consider the last block on the stack when looking for places to attac…
rachel-fenichel Mar 12, 2016
9ce81a2
Localisation updates from https://translatewiki.net.
Nikerabbit Mar 14, 2016
0aec80a
Add missing comma to Lua reserved words
drigz Mar 14, 2016
37d3ecc
Fix JSDoc syntax on Blockly.Lua.lists.getIndex_
drigz Mar 14, 2016
7f1081f
Merge pull request #283 from rachel-fenichel/feature/connect_no_next
rachel-fenichel Mar 14, 2016
7b77527
Merge pull request #284 from rachel-fenichel/feature/last_in_stack
rachel-fenichel Mar 14, 2016
be26265
Merge pull request #285 from drigz/reswords
NeilFraser Mar 14, 2016
02924bc
Merge branch 'master' into develop
NeilFraser Mar 14, 2016
8fb1178
Update message descriptions.
NeilFraser Mar 14, 2016
72bb08a
Add undo/redo.
NeilFraser Mar 15, 2016
95fbc0b
Fix checkbox events. Fix block deletion while mutator is open.
NeilFraser Mar 15, 2016
5241c4d
Merge remote-tracking branch 'Google/develop' into upstream-march-15
tmickel Mar 15, 2016
fa64881
Remove Lua generators
tmickel Mar 15, 2016
1d0db41
Recompile March 15
tmickel Mar 15, 2016
430388e
Don't consider ghosts when looking for the closest connection.
rachel-fenichel Mar 15, 2016
dd57be8
Don't fire events for ghost blocks.
rachel-fenichel Mar 15, 2016
cae688e
Merge pull request #123 from tmickel/upstream-march-15
rachel-fenichel Mar 16, 2016
88a3d15
Merge pull request #126 from rachel-fenichel/feature/no_ghost_events
rachel-fenichel Mar 18, 2016
e6093f7
Don't consider ghosts when looking for the closest connection.
rachel-fenichel Mar 15, 2016
d4c77d0
Merge branch 'bugfix/ghost_different_workspaces' of https://github.co…
rachel-fenichel Mar 18, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 47 additions & 36 deletions blockly_compressed_horizontal.js

Large diffs are not rendered by default.

81 changes: 46 additions & 35 deletions blockly_compressed_vertical.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion blockly_uncompressed_horizontal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blockly_uncompressed_vertical.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 1 addition & 12 deletions blocks/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,7 @@ Blockly.Blocks['lists_create_with'] = {
this.updateShape_();
// Reconnect any child blocks.
for (var i = 0; i < this.itemCount_; i++) {
var connectionChild = connections[i];
if (connectionChild) {
var parent = connectionChild.targetBlock();
var connectionParent = this.getInput('ADD' + i).connection;
if (connectionParent.targetConnection != connectionChild &&
(!parent || parent == this)) {
if (connectionParent.targetConnection) {
connectionParent.disconnect();
}
connectionParent.connect(connectionChild);
}
}
Blockly.Mutator.reconnect(connections[i], this, 'ADD' + i);
}
},
/**
Expand Down
12 changes: 3 additions & 9 deletions blocks/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,10 @@ Blockly.Blocks['controls_if'] = {
this.updateShape_();
// Reconnect any child blocks.
for (var i = 1; i <= this.elseifCount_; i++) {
if (valueConnections[i]) {
this.getInput('IF' + i).connection.connect(valueConnections[i]);
}
if (statementConnections[i]) {
this.getInput('DO' + i).connection.connect(statementConnections[i]);
}
}
if (elseStatementConnection) {
this.getInput('ELSE').connection.connect(elseStatementConnection);
Blockly.Mutator.reconnect(valueConnections[i], this, 'IF' + i);
Blockly.Mutator.reconnect(statementConnections[i], this, 'DO' + i);
}
Blockly.Mutator.reconnect(elseStatementConnection, this, 'ELSE');
},
/**
* Store pointers to any connected child blocks.
Expand Down
33 changes: 16 additions & 17 deletions blocks/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ Blockly.Blocks['text_join'] = {
this.updateShape_();
// Reconnect any child blocks.
for (var i = 0; i < this.itemCount_; i++) {
if (connections[i]) {
this.getInput('ADD' + i).connection.connect(connections[i]);
}
Blockly.Mutator.reconnect(connections[i], this, 'ADD' + i);
}
},
/**
Expand All @@ -168,28 +166,29 @@ Blockly.Blocks['text_join'] = {
* @this Blockly.Block
*/
updateShape_: function() {
// Delete everything.
if (this.getInput('EMPTY')) {
if (this.itemCount_ && this.getInput('EMPTY')) {
this.removeInput('EMPTY');
} else {
var i = 0;
while (this.getInput('ADD' + i)) {
this.removeInput('ADD' + i);
i++;
}
} else if (!this.itemCount_ && !this.getInput('EMPTY')) {
this.appendDummyInput('EMPTY')
.appendField(this.newQuote_(true))
.appendField(this.newQuote_(false));
}
// Rebuild block.
if (this.itemCount_ == 0) {
this.appendDummyInput('EMPTY');
} else {
for (var i = 0; i < this.itemCount_; i++) {
// Add new inputs.
for (var i = 0; i < this.itemCount_; i++) {
if (!this.getInput('ADD' + i)) {
var input = this.appendValueInput('ADD' + i);
if (i == 0) {
input.appendField(Blockly.Msg.TEXT_JOIN_TITLE_CREATEWITH);
}
}
}
}
// Remove deleted inputs.
while (this.getInput('ADD' + i)) {
this.removeInput('ADD' + i);
i++;
}
},
newQuote_: Blockly.Blocks['text'].newQuote_
};

Blockly.Blocks['text_create_join_container'] = {
Expand Down
Loading