Skip to content

Commit 12a70b2

Browse files
committed
feat: change default parameters to less bouncy
I got fed up with the overshooting animation.
1 parent b900f1f commit 12a70b2

3 files changed

Lines changed: 14 additions & 16 deletions

File tree

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ As an example of further configuration, you can tune the smear dynamics to be sn
118118
```lua
119119
opts = { -- Default Range
120120
stiffness = 0.8, -- 0.6 [0, 1]
121-
trailing_stiffness = 0.5, -- 0.4 [0, 1]
121+
trailing_stiffness = 0.6, -- 0.45 [0, 1]
122122
stiffness_insert_mode = 0.7, -- 0.5 [0, 1]
123123
trailing_stiffness_insert_mode = 0.7, -- 0.5 [0, 1]
124-
damping = 0.8, -- 0.65 [0, 1]
125-
damping_insert_mode = 0.8, -- 0.7 [0, 1]
124+
damping = 0.95, -- 0.85 [0, 1]
125+
damping_insert_mode = 0.95, -- 0.9 [0, 1]
126126
distance_stop_animating = 0.5, -- 0.1 > 0
127127
},
128128
```
@@ -134,7 +134,7 @@ If you notice a low framerate, you can try lowering the time interval between dr
134134
},
135135
```
136136

137-
You can also change the "bounciness" of the smear by adjusting the `damping` parameter (default to `0.65`). Increasing it (_e.g._ to `0.8`) will reduce the overshoot, while decreasing it (_e.g._ to `0.5`) will make the smear more elastic.
137+
You can also change the "bounciness" of the smear by adjusting the `damping` and `damping_insert_mode` parameters (default to `0.85` and `0.9` respectively). Decreasing them (_e.g._ to `0.65`) will make the smear appear more elastic (overshooting target position).
138138

139139

140140
> **🔥 FIRE HAZARD 🔥**
@@ -164,7 +164,6 @@ If you wish to only have a smoother cursor that keeps its rectangular shape (wit
164164
opts = {
165165
stiffness = 0.5,
166166
trailing_stiffness = 0.5,
167-
damping = 0.67,
168167
matrix_pixel_threshold = 0.5,
169168
},
170169
```

doc/smear-cursor.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ snappier:
120120
>lua
121121
opts = { -- Default Range
122122
stiffness = 0.8, -- 0.6 [0, 1]
123-
trailing_stiffness = 0.5, -- 0.4 [0, 1]
123+
trailing_stiffness = 0.6, -- 0.45 [0, 1]
124124
stiffness_insert_mode = 0.7, -- 0.5 [0, 1]
125125
trailing_stiffness_insert_mode = 0.7, -- 0.5 [0, 1]
126-
damping = 0.8, -- 0.65 [0, 1]
127-
damping_insert_mode = 0.8, -- 0.7 [0, 1]
126+
damping = 0.95, -- 0.85 [0, 1]
127+
damping_insert_mode = 0.95, -- 0.9 [0, 1]
128128
distance_stop_animating = 0.5, -- 0.1 > 0
129129
},
130130
<
@@ -139,9 +139,9 @@ draws (default is 17ms):
139139
<
140140

141141
You can also change the "bounciness" of the smear by adjusting the `damping`
142-
parameter (default to `0.65`). Increasing it (_e.g._ to `0.8`) will reduce the
143-
overshoot, while decreasing it (_e.g._ to `0.5`) will make the smear more
144-
elastic.
142+
and `damping_insert_mode` parameters (default to `0.85` and `0.9`
143+
respectively). Decreasing them (_e.g._ to `0.65`) will make the smear appear
144+
more elastic (overshooting target position).
145145

146146

147147
**FIRE HAZARD **
@@ -169,7 +169,6 @@ If you wish to only have a smoother cursor that keeps its rectangular shape
169169
opts = {
170170
stiffness = 0.5,
171171
trailing_stiffness = 0.5,
172-
damping = 0.67,
173172
matrix_pixel_threshold = 0.5,
174173
},
175174
<

lua/smear_cursor/config.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,25 +93,25 @@ M.stiffness = 0.6
9393

9494
-- How fast the smear's tail moves towards the target.
9595
-- 0: no movement, 1: instantaneous
96-
M.trailing_stiffness = 0.4
96+
M.trailing_stiffness = 0.45
9797

9898
-- Initial velocity factor in the direction opposite to the target
9999
M.anticipation = 0.2
100100

101101
-- Velocity reduction over time. O: no reduction, 1: full reduction
102-
M.damping = 0.65
102+
M.damping = 0.85
103103

104104
-- Controls if middle points are closer to the head or the tail.
105105
-- < 1: closer to the tail, > 1: closer to the head
106-
M.trailing_exponent = 2
106+
M.trailing_exponent = 3
107107

108108
-- Stop animating when the smear's tail is within this distance (in characters) from the target.
109109
M.distance_stop_animating = 0.1
110110

111111
-- Set of parameters for insert mode
112112
M.stiffness_insert_mode = 0.5
113113
M.trailing_stiffness_insert_mode = 0.5
114-
M.damping_insert_mode = 0.7
114+
M.damping_insert_mode = 0.9
115115
M.trailing_exponent_insert_mode = 1
116116
M.distance_stop_animating_vertical_bar = 0.875 -- Can be decreased (e.g. to 0.1) if using legacy computing symbols
117117

0 commit comments

Comments
 (0)