Skip to content

Commit

Permalink
Remove PIPE_STROKE_WIDTH from constants and change to LINE_WIDTH, see:
Browse files Browse the repository at this point in the history
  • Loading branch information
marlitas committed Jun 30, 2022
1 parent 7f36668 commit 258416b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion js/common/MeanShareAndBalanceConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const MeanShareAndBalanceConstants = {
CUP_RANGE_MIN: 0,
CUP_RANGE_MAX: 1,
WATER_LEVEL_DEFAULT: 0.5,
PIPE_STROKE_WIDTH: 1,
PIPE_LENGTH: 50,
CONTROLS_VERTICAL_MARGIN: 30,
CONTROLS_HORIZONTAL_MARGIN: 15,
Expand Down
10 changes: 7 additions & 3 deletions js/intro/view/PipeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const VALVE_RADIUS = 8;
const PIPE_WIDTH = 4;
const HANDLE_HEIGHT = 10;
const HANDLE_WIDTH = 4;
const LINE_WIDTH = 1;

export default class PipeNode extends Node {
private readonly pipeModel: PipeModel;
Expand Down Expand Up @@ -87,8 +88,9 @@ export default class PipeNode extends Node {
.addColorStop( 1, MeanShareAndBalanceColors.pipeGradientDarkColorProperty );

this.innerValve = new Path( createInnerCircle( VALVE_RADIUS, PIPE_WIDTH ),
{ fill: 'black' } );
this.outerValve = new Path( createOuterCircle( VALVE_RADIUS ), { fill: valveGradient, stroke: 'black' } );
{ fill: 'black', lineWidth: LINE_WIDTH } );
this.outerValve = new Path( createOuterCircle( VALVE_RADIUS ),
{ fill: valveGradient, stroke: 'black', lineWidth: LINE_WIDTH } );

// Inner pipe shows water color when pipe is opened.
this.innerPipe = new Rectangle( 0, 0, PIPE_WIDTH, VALVE_RADIUS * 2, {
Expand All @@ -103,6 +105,7 @@ export default class PipeNode extends Node {
this.handleBase = new Rectangle( 0, 0, HANDLE_WIDTH, 3, {
fill: pipeGradient,
stroke: 'black',
lineWidth: LINE_WIDTH,
y: this.outerValve.top - 3,
x: this.innerValve.centerX - HANDLE_WIDTH / 2
} );
Expand All @@ -117,6 +120,7 @@ export default class PipeNode extends Node {
this.handleGrip = new Path( handleShape, {
fill: handleGripGradient,
stroke: 'black',
lineWidth: LINE_WIDTH,
y: this.handleBase.top + 1
} );

Expand Down Expand Up @@ -163,7 +167,7 @@ export default class PipeNode extends Node {
this.addChild( this.valveNode );

// Set position related to associated cup
this.x = pipeModel.x + MeanShareAndBalanceConstants.CUP_WIDTH + MeanShareAndBalanceConstants.PIPE_STROKE_WIDTH / 2;
this.x = pipeModel.x + MeanShareAndBalanceConstants.CUP_WIDTH + LINE_WIDTH / 2;
this.y = modelViewTransform.modelToViewY( 0 ) - PIPE_WIDTH;
}

Expand Down

0 comments on commit 258416b

Please sign in to comment.