AliasIO / Raphael.FreeTransform

Free transform tool for Raphaël elements.
http://elbertf.com
362 stars 107 forks source link

asyncCallback slows down application + fix #141

Open blueberry-media opened 9 years ago

blueberry-media commented 9 years ago

If the asyncCallback is called to fast the timeout is cleared (i think) and the callback is not triggered. To make it async a fix is made with requestAnimationFrame.

            //clearTimeout(timeout);
            //timeout=setTimeout(function() { if ( ft.callback ) { ft.callback(ft, events); } }, 1);
            requestAnimationFrame( function() { if ( ft.callback ) { ft.callback(ft, events); } } );

Could you apply this fix?

AliasIO commented 9 years ago

requestAnimationFrame is not supported in IE8 and IE9 though.

blueberry-media commented 9 years ago

Another fix would be to remove the clearTimeout