Skip to content

Commit

Permalink
visibleProperty passed directly to Node options, see #398
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Mar 21, 2023
1 parent 4ae1890 commit daa2e07
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions js/quadrilateral/view/CornerGuideNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ export default class CornerGuideNode extends Node {
* @param modelViewTransform
*/
public constructor( vertex1: QuadrilateralVertex, vertex2: QuadrilateralVertex, visibleProperty: BooleanProperty, shapeModel: QuadrilateralShapeModel, modelViewTransform: ModelViewTransform2 ) {
super();
super( {

// This node is only visible when "Corner Guides" are enabled by the user
visibleProperty: visibleProperty
} );

// The guide looks like alternating dark and light wedges along the annulus, we accomplish this with two paths
const darkAnglePath = new Path( null, {
Expand Down Expand Up @@ -142,12 +146,6 @@ export default class CornerGuideNode extends Node {
const arcNode = new Node( { children: [ darkAnglePath, lightAnglePath ] } );
this.children = [ arcNode, crosshairPath ];

// This node is only visible when "Corner Guides" are enabled by the user
// REVIEW: pass to super({visibleProperty: visibleProperty})
visibleProperty.link( visible => {
this.visible = visible;
} );

// When at a right angle, display the RightAngleIndicator, otherwise the arcs representing angles are shown.
vertex1.angleProperty.link( angle => {
arcNode.visible = !shapeModel.isRightAngle( angle! );
Expand Down

0 comments on commit daa2e07

Please sign in to comment.