()
| 120 | } |
| 121 | |
| 122 | function syncPointScaleControls() { |
| 123 | let min = Number(state.mapping.pointScaleMin); |
| 124 | let max = Number(state.mapping.pointScaleMax); |
| 125 | if (!Number.isFinite(min)) min = 0; |
| 126 | if (!Number.isFinite(max)) max = min + 1; |
| 127 | if (min < 0) min = 0; |
| 128 | if (max < min) { |
| 129 | max = min; |
| 130 | } |
| 131 | state.mapping.pointScaleMin = min; |
| 132 | state.mapping.pointScaleMax = max; |
| 133 | if (dom.pointScaleMin) dom.pointScaleMin.value = String(min); |
| 134 | if (dom.pointScaleMax) dom.pointScaleMax.value = String(max); |
| 135 | if (dom.pointScale) { |
| 136 | dom.pointScale.min = String(min); |
| 137 | dom.pointScale.max = String(Math.max(max, min)); |
| 138 | const span = Math.max(Math.abs(max - min), 0); |
| 139 | const step = span > 0 ? span / 100 : 0.01; |
| 140 | dom.pointScale.step = step.toFixed(6); |
| 141 | state.mapping.pointScale = clamp( |
| 142 | Number(state.mapping.pointScale), |
| 143 | min, |
| 144 | Math.max(max, min) |
| 145 | ); |
| 146 | dom.pointScale.value = String(state.mapping.pointScale); |
| 147 | scene.setPointScaleFactor(state.mapping.pointScale); |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | function syncLabelScaleControls() { |
| 152 | let min = Number(state.mapping.labelScaleMin); |
no test coverage detected