-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[native][cpp to rust][#8] start porting proximity info state
this one is significantly bigger and more complex than i anticipated.
- Loading branch information
1 parent
c354650
commit bf28196
Showing
8 changed files
with
672 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub(crate) mod proximity_info; | ||
mod proximity_info_params; | ||
mod proximity_info_state; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
native/rust/src/suggest/core/layout/proximity_info_params.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,23 @@ | ||
use std::f32::consts::PI; | ||
|
||
pub const NOT_A_DISTANCE_FLOAT: f32 = -1.0; | ||
pub const MIN_DOUBLE_LETTER_BEELINE_SPEED_PERCENTILE: i32 = 5; | ||
pub const VERTICAL_SWEET_SPOT_SCALE: f32 = 1.0; | ||
pub const VERTICAL_SWEET_SPOT_SCALE_G: f32 = 0.5; | ||
|
||
pub const NEAR_KEY_THRESHOLD_FOR_DISTANCE: f32 = 2.0; | ||
|
||
pub const MARGIN_FOR_PREV_LOCAL_MIN: f32 = 0.01; | ||
|
||
pub const DISTANCE_BASE_SCALE: i32 = 100; | ||
pub const NEAR_KEY_THRESHOLD_FOR_POINT_SCORE: f32 = 0.6; | ||
pub const CORNER_CHECK_DISTANCE_THRESHOLD_SCALE: i32 = 25; | ||
pub const NOT_LOCALMIN_DISTANCE_SCORE: f32 = -1.0; | ||
pub const LOCALMIN_DISTANCE_AND_NEAR_TO_KEY_SCORE: f32 = 1.0; | ||
pub const CORNER_ANGLE_THRESHOLD_FOR_POINT_SCORE: f32 = PI * 2.0 / 3.0; | ||
pub const CORNER_SUM_ANGLE_THRESHOLD: f32 = PI / 4.0; | ||
pub const CORNER_SCORE: f32 = 1.0; | ||
|
||
pub const LAST_POINT_SKIP_DISTANCE_SCALE: i32 = 4; | ||
|
||
// TODO: add the rest when we get to them |
Oops, something went wrong.