mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2025-08-18 21:48:35 +02:00
Compare commits
1 Commits
insets-nav
...
vertical-s
Author | SHA1 | Date | |
---|---|---|---|
|
545a956b0c |
@@ -608,6 +608,10 @@ public final class Pointers implements Handler.Callback
|
|||||||
static final float SPEED_SMOOTHING = 0.7f;
|
static final float SPEED_SMOOTHING = 0.7f;
|
||||||
/** Avoid absurdly large values. */
|
/** Avoid absurdly large values. */
|
||||||
static final float SPEED_MAX = 4.f;
|
static final float SPEED_MAX = 4.f;
|
||||||
|
/** Make vertical sliders slower. The intention is to make the up/down
|
||||||
|
slider slower, as we have less visibility and do smaller movements in
|
||||||
|
that direction. */
|
||||||
|
static final float SPEED_VERTICAL_MULT = 0.5f;
|
||||||
|
|
||||||
public void onTouchMove(Pointer ptr, float x, float y)
|
public void onTouchMove(Pointer ptr, float x, float y)
|
||||||
{
|
{
|
||||||
@@ -621,8 +625,9 @@ public final class Pointers implements Handler.Callback
|
|||||||
return;
|
return;
|
||||||
last_move_ms = System.currentTimeMillis();
|
last_move_ms = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
d += ((x - last_x) * direction_x + (y - last_y) * direction_y)
|
d += ((x - last_x) * speed * direction_x
|
||||||
* speed / _config.slide_step_px;
|
+ (y - last_y) * speed * SPEED_VERTICAL_MULT * direction_y)
|
||||||
|
/ _config.slide_step_px;
|
||||||
update_speed(travelled, x, y);
|
update_speed(travelled, x, y);
|
||||||
// Send an event when [abs(d)] exceeds [1].
|
// Send an event when [abs(d)] exceeds [1].
|
||||||
int d_ = (int)d;
|
int d_ = (int)d;
|
||||||
|
Reference in New Issue
Block a user