Skip to content

Commit

Permalink
Potential fix for #76
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinVallejo committed Jan 10, 2025
1 parent f61cc74 commit 0caaec9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/common/view/QuantumMeasurementHistogram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,11 @@ class QuantumMeasurementHistogram extends Node {
],
( leftNumber, rightNumber ) => {
const leftProportion = totalNumberProperty.value ? leftNumber / totalNumberProperty.value : 0;
leftPercentageProperty.value = leftProportion * 100;
leftPercentageProperty.value = Utils.clamp( leftProportion * 100, 0, 100 );
leftHistogramBar.setRect( 0, 0, options.barWidth, leftProportion * maxBarHeight );
leftHistogramBar.bottom = xAxis.centerY;
const rightProportion = totalNumberProperty.value ? rightNumber / totalNumberProperty.value : 0;
rightPercentageProperty.value = rightProportion * 100;
rightPercentageProperty.value = Utils.clamp( rightProportion * 100, 0, 100 );
rightHistogramBar.setRect( 0, 0, options.barWidth, rightProportion * maxBarHeight );
rightHistogramBar.bottom = xAxis.centerY;

Expand Down

0 comments on commit 0caaec9

Please sign in to comment.