Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(project): add smooth and fast cursor presets and retune motion defaults

Richie McIlroybcdbd05e3b05
diff --git a/crates/project/src/configuration.rs b/crates/project/src/configuration.rs
index c7699f0ec..ca8927f94 100644
--- a/crates/project/src/configuration.rs
+++ b/crates/project/src/configuration.rs
@@ -414,9 +414,11 @@ pub enum CursorType {
#[serde(rename_all = "camelCase")]
pub enum CursorAnimationStyle {
Slow,
+ Smooth,
#[default]
- #[serde(alias = "regular", alias = "quick", alias = "rapid", alias = "fast")]
+ #[serde(alias = "regular", alias = "quick", alias = "rapid")]
Mellow,
+ Fast,
Custom,
}
@@ -456,9 +458,9 @@ pub struct ScreenMovementSpring {
impl Default for ScreenMovementSpring {
fn default() -> Self {
Self {
- stiffness: 200.0,
- damping: 40.0,
- mass: 2.25,
+ stiffness: 120.0,
+ damping: 14.0,
+ mass: 1.0,
}
}
}
@@ -471,11 +473,21 @@ impl CursorAnimationStyle {
mass: 2.25,
friction: 40.0,
}),
+ Self::Smooth => Some(CursorSmoothingPreset {
+ tension: 80.0,
+ mass: 2.5,
+ friction: 28.0,
+ }),
Self::Mellow => Some(CursorSmoothingPreset {
tension: 470.0,
mass: 3.0,
friction: 70.0,
}),
+ Self::Fast => Some(CursorSmoothingPreset {
+ tension: 380.0,
+ mass: 1.0,
+ friction: 30.0,
+ }),
Self::Custom => None,
}
}
@@ -520,7 +532,7 @@ impl Default for CursorConfiguration {
mass: 3.0,
friction: 70.0,
raw: false,
- motion_blur: 1.0,
+ motion_blur: 0.3,
use_svg: true,
rotation_amount: Self::default_rotation_amount(),
base_rotation: 0.0,
@@ -1190,7 +1202,7 @@ fn camera_config_needs_migration(value: &Value) -> bool {
impl ProjectConfiguration {
fn default_screen_motion_blur() -> f32 {
- 1.0
+ 0.3
}
pub fn validate(&self) -> Result<(), AnnotationValidationError> {