]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/item/listbox.qc
Merge branch 'master' into Mario/duel
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / item / listbox.qc
index 07385e91e68ac0dde198ac54ce2377ecbadaf6b6..c455d2f5ab6c30cd42eee4d01f8dc39edac24f1d 100644 (file)
                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;