Skip to content

Fix crash when modifier Frequency is dragged to zero - #35

Merged
AristurtleDev merged 1 commit into
developfrom
fix/23-opacityfastfade-frequency-0-crash
Mar 25, 2026
Merged

AristurtleDev merged 1 commit into
developfrom
fix/23-opacityfastfade-frequency-0-crash

Conversation

@AristurtleDev

Copy link
Copy Markdown
Contributor

Description

Fixes a crash reported when the Frequency property of any modifier is set to zero. The Modifier.Frequency setter throws ArgumentOutOfRangeException for any value less than or equal to zero, and a value of zero would also cause a division by zero when computing _cycleTime = 1f / _frequency.

The drag control in the editor was using a minimum of 0.0f, allowing the user to reach the invalid value through normal interaction.

Related Issues/Tickets

Changes Made

  • Changed the min argument on the Frequency DragFloatProperty call in ModifiersView.cs from 0.0f to 0.1f, matching the drag step size and ensuring the control cannot produce a value that violates the setter's contract.

Checklist

  • I have verified that there are no existing pull requests that would overlap with this pull request.
  • I have verified that I am following the guidelines as outlined in this project's contribution policy
  • I have verified that this pull request adheres to this project's code of conduct.
  • I have written a descriptive title for this pull request.
  • I have provided appropriate test coverage were applicable.

@github-actions github-actions Bot added Platform: Cross-platform All platforms Status: Review Needed Ready for code review Type: Bug Something is broken labels Mar 25, 2026
@AristurtleDev
AristurtleDev merged commit e02e948 into develop Mar 25, 2026
1 check passed
@AristurtleDev
AristurtleDev deleted the fix/23-opacityfastfade-frequency-0-crash branch March 25, 2026 17:48
@github-actions github-actions Bot added Status: Completed Work finished and removed Status: Review Needed Ready for code review labels Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Platform: Cross-platform All platforms Status: Completed Work finished Type: Bug Something is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash when OpacityFastFade Frequency Set to 0

1 participant