Skip to content

Commit

Permalink
convert ModelViewTransform to TS
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Apr 13, 2022
1 parent b72b793 commit e0611ff
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions js/common/view/CAVPlotNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,12 @@ class CAVPlotNode extends Node {
dotRadius - MARGIN_Y - MedianBarNode.NOTCH_HEIGHT;

const rightmostDot = sortedDots[ sortedDots.length - 1 ];
const left = modelViewTransform.modelToViewX( leftmostDot.valueProperty.value );
const right = modelViewTransform.modelToViewX( rightmostDot.valueProperty.value );
const medianPositionX = modelViewTransform.modelToViewX( medianValue );
assert && assert( leftmostDot.valueProperty.value !== null );
const left = modelViewTransform.modelToViewX( leftmostDot.valueProperty.value! );
assert && assert( rightmostDot.valueProperty.value !== null );
const right = modelViewTransform.modelToViewX( rightmostDot.valueProperty.value! );
assert && assert( medianValue !== null );
const medianPositionX = modelViewTransform.modelToViewX( medianValue! );

this.medianBarNode.setMedianBarShape( barY, left, medianPositionX, right, model.isMedianAnimationCompleteProperty.value );
}
Expand Down

0 comments on commit e0611ff

Please sign in to comment.