Comment 1 for bug 1343334

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

This should fix the problem.

        function mouseMoveSlowly(item, x, y, dx, dy, steps, stepdelay) {
            mouseMove(item, x, y);
            var abs_dx = Math.abs(dx)
            var abs_dy = Math.abs(dy)
            var step_dx = dx / steps;
            var step_dy = dy /steps;

            var ix = 0;
            var iy = 0;

            for (var step=0; step < steps; step++) {
                if (ix < abs_dx) {
                    ix += step_dx;
                }
                if (iy < abs_dy) {
                    iy += step_dy;
                }
                mouseMove(item, x + ix, y + iy, stepdelay);
            }
        }