Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue snap 0.5.1 getBBox or animate ? #505

Closed
pfx81 opened this issue Feb 8, 2017 · 6 comments
Closed

Issue snap 0.5.1 getBBox or animate ? #505

pfx81 opened this issue Feb 8, 2017 · 6 comments
Assignees

Comments

@pfx81
Copy link

pfx81 commented Feb 8, 2017

With this code the red square is supposed to turn from its center but this is not the case with snap 0.5.1?
Can anyone confirm if this is a bug?

var s = Snap("#svg1"); 

var r1 = s.rect(100,100,100,100).attr({fill: 'green'});
var r2 = s.rect(100,100,100,100).attr({fill: 'red'});
var r2BB = r2.getBBox();

r2.animate({transform: "r" + [90, r2BB.cx, r2BB.cy]}, 5000);

tanks

@pfx81
Copy link
Author

pfx81 commented Feb 9, 2017

Sorry for not deepening. The problem seems to be related to el.animate. The square does not rotate from its center with this code : r2.animate({transform: "r90,150,150"}, 5000);

@ibrierley
Copy link
Collaborator

Can confirm this. Wonder if this is related to the recent matrix animation changes I think I read about.

@DmitryBaranovskiy DmitryBaranovskiy self-assigned this Feb 10, 2017
@ThomasBrierley
Copy link
Contributor

ThomasBrierley commented Feb 13, 2017

Just chiming in here... this is broadly affecting most of my existing animations too.
No It's not, I have a different issue, mine is not animating at all with transforms... I'll make a separate issue.

[EDIT]

deg postfix seems to be depreciated for rotate in v0.5 (intentionally or otherwise), plain SVG doesn't allow it anyway and I don't care so never mind.

@ibrierley
Copy link
Collaborator

I think there's a problem with rotations of 360 degrees not working (or 350 rotating backwards iyswim)

@ThomasBrierley
Copy link
Contributor

ThomasBrierley commented Feb 13, 2017

git bisect points to 2e6a2af (completely broken) and 1492b44 (current behaviour)

Looks to be in 2e6a2af, which fixes #1036 which doesn't exist. I think Dmitri will know what to do with this.

@ibrierley I tested bisect for 350 == -10 issue and it points at same commit.

DmitryBaranovskiy added a commit that referenced this issue Feb 13, 2017
@DmitryBaranovskiy
Copy link
Contributor

This commit should fix this issue. Equalising transforms is a complicated task.

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

No branches or pull requests

4 participants