Skip to content

Commit

Permalink
layout bug, fixes #162
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Aug 30, 2023
1 parent 5356ec1 commit 2a05936
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/decay/view/HalfLifeNumberLineNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,18 +333,22 @@ class HalfLifeNumberLineNode extends Node {
halfLifeArrow.translation = new Vector2( this.chartTransform.modelToViewX( xPosition ),
numberLineCenterY - options.halfLifeArrowLength );

const bottomPosition = this.halfLifeArrowRotationProperty.value === ROTATION_POINTING_RIGHT_RADIANS ?
halfLifeArrow.centerY :
halfLifeArrow.top;

// Static positioning.
if ( options.isHalfLifeLabelFixed ) {
this.halfLifeDisplayNode.left = this.left + BANConstants.INFO_BUTTON_INDENT_DISTANCE
+ BANConstants.INFO_BUTTON_MAX_HEIGHT + 10;
this.halfLifeDisplayNode.bottom = halfLifeArrow.top - 8;
this.halfLifeDisplayNode.bottom = bottomPosition - 8;
}
else {

// Translate the half life text also.
this.halfLifeDisplayNode.centerBottom =
new Vector2( this.chartTransform.modelToViewX( xPosition ),
halfLifeArrow.top - ARROW_TOP_MARGIN );
bottomPosition - ARROW_TOP_MARGIN );


// Make sure the text never goes over the edge of the numberLineNode.
Expand Down

0 comments on commit 2a05936

Please sign in to comment.