Scale the selection boundary. Reproduces computations performed by RangeManager when changing the range
(val, old_rng, new_rng)
| 468 | _verify_range(full_range) |
| 469 | |
| 470 | def _scale_selection(val, old_rng, new_rng): |
| 471 | """ |
| 472 | Scale the selection boundary. Reproduces computations performed by |
| 473 | RangeManager when changing the range |
| 474 | """ |
| 475 | val -= old_rng[0] |
| 476 | val *= (new_rng[1] - new_rng[0]) / (old_rng[1] - old_rng[0]) |
| 477 | val += new_rng[0] |
| 478 | return val |
| 479 | |
| 480 | def _clip_selection(sel, rng, selection_to_range_min): |
| 481 | """ |
no outgoing calls
no test coverage detected