Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Only animate CGSize and CGPoint key paths additively if additive is enabled. #72

Merged
merged 3 commits into from
Nov 29, 2017

Conversation

jverkoey
Copy link
Contributor

@jverkoey jverkoey commented Nov 29, 2017

Prior to this change, CGSize and CGPoint animations were being animated additively even if the additive property was disabled.

Added tests to catch regressions in the future.

@jverkoey jverkoey requested review from samnm and romoore November 29, 2017 16:00
…nabled.

Prior to this change, CGSize and CGPoint animations were being animated additively even if the additive property was disabled.

Added tests to catch regressions in the future.

timing = MotionTiming(delay: 0,
duration: 1,
curve: MotionCurveMakeBezier(p1x: 0, p1y: 0, p2x: 0, p2y: 0),
Copy link
Contributor

@romoore romoore Nov 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm probably misunderstanding timing curves, but doesn't this timing curve mean "never go to the 'to' value"? If all control points are zero?

Copy link
Contributor Author

@jverkoey jverkoey Nov 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are four control points in a cubic bezier, p0 and p3 represent the anchor points — respectively anchored at 0, 0, and 1,1 — and p1 and p2 are the control points. This API accepts p1 and p2.


While this particular cubic bezier is odd, it's not particularly important for the purposes of this test.

XCTAssertTrue(animation.isAdditive, "Animation is not additive when it should be.")
}

func testPositionKeyPathsAnimateAdditively() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit/naming: test__Point__KeyPathsAnimateAdditively

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


XCTAssertTrue(animation.isAdditive, "Animation is not additive when it should be.")
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are CGRect not additive no matter what?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently no. CGRect support isn't currently implemented.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#74

@jverkoey jverkoey merged commit 524b3cb into develop Nov 29, 2017
@jverkoey jverkoey deleted the additive branch November 29, 2017 20:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants