Skip to content

Commit

Permalink
limit detection count to avoid range error, see #63
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed Nov 26, 2024
1 parent bf209ad commit 2a12dea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/photons/model/PhotonDetector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default class PhotonDetector implements TPhotonInteraction {
{ interactionType: 'none' };

if ( detectionResult.interactionType === 'absorbed' ) {
this.detectionCountProperty.value++;
this.detectionCountProperty.value = Math.min( this.detectionCountProperty.value + 1, COUNT_RANGE.max );
this.detectionRateProperty.countEvent();
}

Expand Down

0 comments on commit 2a12dea

Please sign in to comment.