Commit 6ea4211
authored
fix: ColorModifier bugs - swapped min/max calculation and global wasm reference (#189)
## Summary
Fixes #184
Fixes three bugs in the ColorModifier:
1. **Swapped min/max calculation** (lines 164-166): `Math.max` and
`Math.min` were swapped, causing incorrect min/max values
2. **Global wasm reference** (line 157): Uses global `wasm` variable
instead of `input.wasm`
3. **Debug code in production** (line 162): Removed
`window.perAtomArray` assignment
## Changes
- Fixed min/max calculation by swapping Math.max/min
- Replaced `wasm` with `input.wasm` for proper scoping
- Removed debug code `window.perAtomArray` assignment
## Impact
The swapped min/max values were causing incorrect color mapping for
particle visualization based on compute values.
---
This pull request contains changes generated by a Cursor Cloud Agent
<a
href="https://cursor.com/background-agent?bcId=bc-242f3cde-9d37-4376-92bc-3baf88c02fec"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/open-in-cursor-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/open-in-cursor-light.svg"><img alt="Open in
Cursor"
src="https://cursor.com/open-in-cursor.svg"></picture></a> <a
href="https://cursor.com/agents?id=bc-242f3cde-9d37-4376-92bc-3baf88c02fec"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/open-in-web-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/open-in-web-light.svg"><img alt="Open in Web"
src="https://cursor.com/open-in-web.svg"></picture></a>1 file changed
+10
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
167 | 169 | | |
168 | 170 | | |
169 | 171 | | |
| |||
0 commit comments