AliasIO / Raphael.FreeTransform

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

applyLimits function typos #147

Closed MetoooRepo closed 9 years ago

MetoooRepo commented 9 years ago

Hi, in the ApplyLimits function there are some typos

// Line 1080
// Keep center within boundaries
            if ( ft.opts.boundary ) {
                ft.opts.boundarywidth  = ft.opts.boundarywidth  || getPaperSize().x * (ft.o.viewBoxRatio && ft.o.viewBoxRatio.x || 1);
                ft.opts.boundaryheight = ft.opts.boundaryheight || getPaperSize().y * (ft.o.viewBoxRatio && ft.o.viewBoxRatio.y || 1);

                if ( ft.attrs.center.x + ft.attrs.translate.x < ft.opts.boundaryx ) {
                    ft.attrs.translate.x += ft.opts.boundaryx - ( ft.attrs.center.x + ft.attrs.translate.x );
                }

                if ( ft.attrs.center.y + ft.attrs.translate.y < ft.opts.boundaryy ) {
                    ft.attrs.translate.y += ft.opts.boundaryy - ( ft.attrs.center.y + ft.attrs.translate.y );
                }

                if ( ft.attrs.center.x + ft.attrs.translate.x > ft.opts.boundaryx + ft.opts.boundarywidth  ) {
                    ft.attrs.translate.x += ft.opts.boundaryx + ft.opts.boundarywidth - ( ft.attrs.center.x + ft.attrs.translate.x );
                }

                if ( ft.attrs.center.y + ft.attrs.translate.y > ft.opts.boundaryy + ft.opts.boundaryheight ) {
                    ft.attrs.translate.y += ft.opts.boundaryy + ft.opts.boundaryheight - ( ft.attrs.center.y + ft.attrs.translate.y );
                }
            }

ft.opts.boundaryx should be ft.opts.boundary.x ft.opts.boundaryy should be ft.opts.boundary.y

AliasIO commented 9 years ago

Thank you, this has been fixed.