Skip to content

Commit

Permalink
Allow attachments to black box vertices that are attached to external…
Browse files Browse the repository at this point in the history
… wires, see #141
  • Loading branch information
samreid committed Jul 3, 2016
1 parent 7b07f52 commit 8a6a505
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/common/model/Circuit.js
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ define( function( require ) {
} );

// (9) When in Black Box "build" mode (i.e. building inside the black box), a vertex user cannot connect to
// a black bax interface vertex if its other vertices would be outside of the black box. See #136
// a black box interface vertex if its other vertices would be outside of the black box. See #136
if ( mode === 'build' ) {
var connectedVertices = this.findAllConnectedVertices( vertex );
candidateVertices = candidateVertices.filter( function( candidateVertex ) {
Expand All @@ -749,7 +749,11 @@ define( function( require ) {

// OK for black box interface vertex to be slightly outside the box
}
else if ( connectedVertex !== vertex && !blackBoxBounds.containsPoint( connectedVertex.position ) ) {
else if ( connectedVertex !== vertex && !blackBoxBounds.containsPoint( connectedVertex.position ) &&

// exempt wires connected outside of the black box, which are flagged as un-attachable in
// build mode, see #141
connectedVertex.attachable ) {
return false;
}
}
Expand Down

0 comments on commit 8a6a505

Please sign in to comment.