From dd933921c22a2ad0822fe33d8d1420d1663bb8fe Mon Sep 17 00:00:00 2001 From: denz1994 Date: Tue, 29 May 2018 17:47:13 -0400 Subject: [PATCH] Background added to massNodes so all svg elements are painted. #278. --- js/common/view/MassNode.js | 4 ++++ js/lab/view/PeriodTraceNode.js | 1 + 2 files changed, 5 insertions(+) diff --git a/js/common/view/MassNode.js b/js/common/view/MassNode.js index 10159beb..3734c041 100644 --- a/js/common/view/MassNode.js +++ b/js/common/view/MassNode.js @@ -121,6 +121,10 @@ define( function( require ) { } ); this.addChild( this.hookNode ); + // Background added so all of svg elements are painted. See https://github.com/phetsims/masses-and-springs/issues/278 + this.background = new Rectangle( this.bounds.dilated( 1.10 ), { pickable: false } ); + this.addChild( this.background ); + if ( !mass.icon ) { var labelString = mass.mysteryLabel ? questionMarkString : StringUtils.fillIn( massValueString, { mass: mass.mass * 1000 } ); var label = new Text( labelString, { diff --git a/js/lab/view/PeriodTraceNode.js b/js/lab/view/PeriodTraceNode.js index 5bd0dd30..87b62e57 100644 --- a/js/lab/view/PeriodTraceNode.js +++ b/js/lab/view/PeriodTraceNode.js @@ -118,6 +118,7 @@ define( function( require ) { // second line this.shape.verticalLineTo( state === 2 ? currentYPosition : secondPeakYPosition + this.path.lineWidth / 2 ); if ( state > 2 && !this.periodTrace.thresholdReached ) { + // second connector this.shape.horizontalLineTo( this.lastX );