Skip to content

Commit

Permalink
Clamp position of median readout node for cards, remove TODOS, see #46
Browse files Browse the repository at this point in the history
…and #45
  • Loading branch information
chrisklus committed Feb 27, 2022
1 parent 1ac7193 commit 4e24e9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 4 additions & 3 deletions js/common/view/NumberCardContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,11 @@ class NumberCardContainer extends Node {
this.medianBarsNode.clear();
}

// TODO: Better guard on model.isShowingTopMedianProperty.value
if ( leftmostCard ) {

// TODO-UX: Can show median label outside of accordion box for small numbers
medianReadoutPanel.centerX = getCardPositionX( ( this.cardNodeCells.length - 1 ) / 2 ) + leftmostCard.width / 2;
if ( medianReadoutPanel.left < 0 ) {
medianReadoutPanel.left = 0;
}
medianReadoutPanel.top = leftmostCard.bottom + MARGIN_Y + 13;
medianReadoutPanel.visible = model.isShowingTopMedianProperty.value;
}
Expand All @@ -262,6 +262,7 @@ class NumberCardContainer extends Node {
}
};
this.cardNodeCellsChangedEmitter.addListener( updateMedianNode );
model.medianValueProperty.link( updateMedianNode );
model.isShowingTopMedianProperty.link( updateMedianNode );
}

Expand Down
2 changes: 0 additions & 2 deletions js/common/view/PredictionNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ class PredictionNode extends Node {
const options = optionize<PredictionNodeOptions, PredictionNodeSelfOptions, NodeOptions>( {
tandem: Tandem.REQUIRED,
children: [ arrowNode, shadedSphereNode ],

// TODO-UX: Touch area
cursor: 'pointer'
}, providedOptions );

Expand Down

0 comments on commit 4e24e9a

Please sign in to comment.