Commit 1ee54f7
committed
Fix: Correctly merge overlapping points in LFO editor
Previously, duplicate points created by tools like the square brush were not being merged. This resulted in a poor user experience, as multiple points could exist at the same visual location. Dragging such a point would only move one, leaving the others behind and breaking the perceived shape.
This commit resolves the issue by replacing the direct comparison with a robust, epsilon-based distance check.
Key changes:
- Implemented `mergeDuplicatePoints()` to use `getDistanceFrom()` with a small epsilon to correctly identify points that are effectively duplicates.
- The function now manually rebuilds the points list, ensuring that the `curvatures` array is kept in sync with the points array, preventing data corruption and potential crashes.
- The merge function is now called after mouse-up events (e.g., finishing a brush stroke or drag), ensuring the LFO data is always clean.1 parent 4076046 commit 1ee54f7
File tree
3 files changed
+49
-6
lines changed- Source
- DSP
- Panels/ControlPanel
- tests/Presets
3 files changed
+49
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
45 | 90 | | |
46 | 91 | | |
47 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
| 520 | + | |
| 521 | + | |
520 | 522 | | |
521 | 523 | | |
522 | 524 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
| 36 | + | |
38 | 37 | | |
39 | 38 | | |
40 | | - | |
41 | | - | |
| 39 | + | |
42 | 40 | | |
43 | 41 | | |
44 | 42 | | |
| |||
47 | 45 | | |
48 | 46 | | |
49 | 47 | | |
50 | | - | |
51 | | - | |
52 | 48 | | |
53 | 49 | | |
54 | 50 | | |
| |||
0 commit comments