mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
better fix for the camera jerk of the emoticon selector
This commit is contained in:
parent
36c9bc5bb9
commit
66ec159da7
|
@ -850,16 +850,18 @@ void render_game()
|
|||
float deadzone = config.cl_mouse_deadzone;
|
||||
float follow_factor = config.cl_mouse_followfactor/100.0f;
|
||||
float mouse_max = min(camera_max_distance/follow_factor + deadzone, (float)config.cl_mouse_max_distance);
|
||||
|
||||
// TODO: static works, but kinda ugly, it's so that the camera doesn't jerkoff when we wanna select emote
|
||||
static vec2 camera_offset(0, 0);
|
||||
vec2 camera_offset(0, 0);
|
||||
|
||||
// fetch new input
|
||||
if(!menu_active && !emoticon_selector_active)
|
||||
if(!menu_active)
|
||||
{
|
||||
int x, y;
|
||||
if(!emoticon_selector_active)
|
||||
{
|
||||
inp_mouse_relative(&x, &y);
|
||||
mouse_pos += vec2(x, y);
|
||||
}
|
||||
|
||||
if(spectate)
|
||||
{
|
||||
if(mouse_pos.x < 200.0f) mouse_pos.x = 200.0f;
|
||||
|
|
Loading…
Reference in a new issue