Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

Rotate issue if origin of paper is not (0,0) #125

Open
neilyoung opened this issue Apr 26, 2014 · 0 comments
Open

Rotate issue if origin of paper is not (0,0) #125

neilyoung opened this issue Apr 26, 2014 · 0 comments

Comments

@neilyoung
Copy link

Hi,

I'm using your fine component with great success. Now I need to origin the paper on another point, not at (0,0).

There is an issue with the rotation behavior of an object, if the paper is not originated at (0,0).

Here is your sample code with one change: I'm forced to NOT allow handles for rotation, so the FreeTransform is setup like this:

ft = paper.freeTransform(rect, { keepRatio: true, rotate:['self']}, function(ft, events) {
    console.log(ft.attrs);
});

This works fine with your sample as shown here:

http://maps.alphadex.de/ra/sample.html

You can touch the object and rotate it.

Now I'm just instantiating the paper at a different left offset:

var paper = Raphael(400, 0, 500, 500);

The result is shown here:

http://maps.alphadex.de/ra/fail.html

Please not the horrible rotate behavior. BTW: It rotates fine, even if relocated, if I rotate using the handles, but this is no option in my case, unfortunately. It does also not rotate correctly, if the top offset is other than 0, either alone or together with a >0 left offset.

Any pointer welcome.
Regards

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant