AliasIO / Raphael.FreeTransform

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

ScrollTop and ScrollLeft not respected #144

Open sabufrancis opened 9 years ago

sabufrancis commented 9 years ago

Hi I am using FreeTransform plugin in an application where I've implemented a zoom and pan feature too. Moreover; the page in which the rendered canvas exists has a vertical scrollbar.

I noticed that when I hav scrolled the page down; and as I drag an object the mouse is one location but the object is itself shifted

I implemented the following in the draggables.map(function(draggable) (approx line 596)

ft.attrs.translate.x = ft.o.translate.x + dx - $(window).scrollLeft()* ft.o.viewBoxRatio.x;; ft.attrs.translate.y = ft.o.translate.y + dy - $(window).scrollTop()* ft.o.viewBoxRatio.y;

The above seems to work (I am assuming Jquery is present) Is there anywhere else I have to change ?

Regards Sabu Francis