From 8a6a5051e4fe4c34b5e984dcd1032b16eb6d7fa0 Mon Sep 17 00:00:00 2001 From: samreid Date: Sun, 3 Jul 2016 09:42:17 -0600 Subject: [PATCH] Allow attachments to black box vertices that are attached to external wires, see #141 --- js/common/model/Circuit.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/common/model/Circuit.js b/js/common/model/Circuit.js index bfd70631..40af5930 100644 --- a/js/common/model/Circuit.js +++ b/js/common/model/Circuit.js @@ -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 ) { @@ -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; } }