diff options
| author | Jacob Palecki <[email protected]> | 2021-04-09 17:38:32 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2021-04-09 17:38:32 -0700 |
| commit | f1aae3548db5096fbea879d5c92cec532e606e5b (patch) | |
| tree | 86e5d8c489e83a653b663e11bbec8254f9360b6c /common | |
| parent | Mostly working now (diff) | |
| download | rawaccel-f1aae3548db5096fbea879d5c92cec532e606e5b.tar.xz rawaccel-f1aae3548db5096fbea879d5c92cec532e606e5b.zip | |
additional fixes
Diffstat (limited to 'common')
| -rw-r--r-- | common/accel-lookup.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/accel-lookup.hpp b/common/accel-lookup.hpp index 4314bfa..968eb6a 100644 --- a/common/accel-lookup.hpp +++ b/common/accel-lookup.hpp @@ -254,9 +254,9 @@ namespace rawaccel { first_log_lookup_speed = exp(start*1.0); int end = static_cast<int>(floor(log(last_point_speed))); last_log_lookup_speed = exp(end*1.0); - int num = static_cast<int>(capacity / (end - start)); + int num = end > start ? static_cast<int>(capacity / (end - start)) : 1; range = fp_rep_range{ start, end, num }; - last_log_lookup_index = num * (end - start) - 1; + last_log_lookup_index = end > start ? num * (end - start) - 1 : 0; vec2<float> current = {0, 0}; vec2<float> next; |