if (me.pressed == 1)
{
hit = 1;
- if (pos.x < 1 - me.controlWidth - me.tolerance.y * me.controlWidth) hit = 0;
- if (pos.y < 0 - me.tolerance.x) hit = 0;
- if (pos.x >= 1 + me.tolerance.y * me.controlWidth) hit = 0;
- if (pos.y >= 1 + me.tolerance.x) hit = 0;
+ if (pos.x < 1 - me.controlWidth - me.tolerance.x * me.controlWidth) hit = 0;
+ if (pos.y < 0 - me.tolerance.y) hit = 0;
+ if (pos.x >= 1 + me.tolerance.x * me.controlWidth) hit = 0;
+ if (pos.y >= 1 + me.tolerance.y) hit = 0;
if (hit)
{
// calculate new pos to v
}
}
AUTOCVAR(menu_scroll_averaging_time, float, 0.16, "smooth scroll averaging time");
-// scroll faster while dragging the scrollbar
+ // scroll faster while dragging the scrollbar
AUTOCVAR(menu_scroll_averaging_time_pressed, float, 0.06, "smooth scroll averaging time when dragging the scrollbar");
void ListBox_draw(entity me)
{
if (me.scrollPos != me.scrollPosTarget)
{
float averaging_time = (me.pressed == 1)
- ? autocvar_menu_scroll_averaging_time_pressed
+ ? autocvar_menu_scroll_averaging_time_pressed
: autocvar_menu_scroll_averaging_time;
// this formula works with whatever framerate
float f = averaging_time ? exp(-frametime / averaging_time) : 0;