Summary: | Animation of -webkit-transform matrix() function should not do linear interpolation | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Marrin <cmarrin> | ||||||
Component: | CSS | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | dino, simon.fraser | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Mac | ||||||||
OS: | OS X 10.5 | ||||||||
Attachments: |
|
Description
Chris Marrin
2008-09-05 08:59:05 PDT
Created attachment 23195 [details]
Patch to fix bug
Comment on attachment 23195 [details]
Patch to fix bug
Just style nits.
+ double sx, sy;
+ double angle;
We don't usually pre declare variables.
+ /* Compute scaling factors. */
We tend to use C++ style comments. This issue is in a few
+ sx = sqrt (m.a() * m.a() + m.b() * m.b());
+ sy = sqrt (m.c() * m.c() + m.d() * m.d());
Space after sqrt.
+ angle = atan2 (m.b(), m.a());
Space after atan2.
+ int i;
No need to pre declare this.
+ srA[2] += srA[2] < 0 ? M_PI : -M_PI;
+ }
+
+ // Don't rotate the long way around.
+ srA[2] = fmod(srA[2], 2.0 * M_PI);
+ srB[2] = fmod(srB[2], 2.0 * M_PI);
+
+ if (fabs (srA[2] - srB[2]) > M_PI) {
+ if (srA[2] > srB[2])
+ srA[2] -= M_PI * 2.0;
+ else
+ srB[2] -= M_PI * 2.0;
+ }
We use piDouble/piFloat instead of M_PI
Created attachment 23206 [details]
New patch fixing nits
Comment on attachment 23206 [details]
New patch fixing nits
Still one space after function name.
+ if (fabs (srA[2] - srB[2]) > piDouble) {
Please fix that before landing. r=me
M LayoutTests/ChangeLog A LayoutTests/animations/matrix-anim-expected.txt A LayoutTests/animations/matrix-anim.html M WebCore/ChangeLog M WebCore/platform/graphics/AffineTransform.cpp M WebCore/platform/graphics/AffineTransform.h M WebCore/rendering/style/RenderStyle.cpp Committed r36274 |