Commit Graph
35 Commits
Author SHA1 Message Date
cacaodev 81916d0f45 FIXED: A grouping context does not inherit the completion handler ...
… from the current context.
Also removed CPAnimationContext -copy method. CPAnimationContext is not
CPCopying compliant.

TEST: CPAnimationContextTest ->
testCompletionHandlerWithoutAnimatorWithGrouping2
2017-07-25 12:04:58 +02:00
cacaodev 03dccbe613 Add a manual test for the previous fixes.
The tests must be run independently because animations are launched at
the end of the current run loop.
2017-06-30 12:26:15 +02:00
cacaodev 1ccec65619 Add debug information 2017-06-30 12:03:29 +02:00
cacaodev b78e9062a1 CompletionHandlerAgent fire() is a one shot. 2017-06-30 12:03:09 +02:00
cacaodev dc87354702 CPAnimationContext setCompletionHandler: add an equality check 2017-06-30 12:00:08 +02:00
cacaodev 6f1c0fa4a8 FIXED: CPAnimationContext completionHandler was not called
Previously, if a context group was not generating any animation (no
calls to animator or non implemented method in the animator proxy), the
completionHandler was not called.
If the end value (frame, frameorigin, frameSize) was equal to the start
value, the completionHandler was not called neither.

This commit makes sure that the completionHandlerAgent counter is
incremented by the count of animations that actually start.
2017-06-12 12:46:05 +02:00
cacaodev 6bf2d6c1ab Move css animation creation & frame updaters to CPViewAnimator
Reason: • consistency : animations handled by animator.
• Views can now animate several DOM elements. For example
a view with a nine part image need to animate its sub divs.

• Do not create any css animation when the start and end values are
equal and there is no intermediate values.

+ This commit adds an optional method to CPView
- (CGRect)frameRectOfView:(CPView)aView inSuperviewSize:(CGSize)aSize
Returns the frame of a view given its superview frame. This will allow
views implementing -layoutSubviews to gain an optional declarative
layout. The animation system will use this method to compute the end
value of an animation.
2017-03-02 10:30:09 +01:00
cacaodev cebd51aac1 reduce the number of args in a private method 2017-03-02 10:30:08 +01:00
cacaodev 42b8b3aa75 Ask the animator if periodic frame updates are needed 2017-03-02 10:30:08 +01:00
cacaodev c0eaf79d25 Remove jshashtable.js in favor of Map() 2017-03-02 10:30:07 +01:00
cacaodev fb2fe3eb63 Enable forced frame updates in CPViewAnimator 2017-03-02 10:30:07 +01:00
cacaodev 184d63f7eb Move the FrameUpdater function to CPViewAnimator 2017-03-02 10:30:07 +01:00
cacaodev 14ebd58c96 Move CFRunLoopObserver to CPRunLoop.j as a global function 2017-03-02 10:30:05 +01:00
cacaodev 3edddb8e91 Add CSSAnimation.description() function 2017-03-02 10:30:05 +01:00
cacaodev d2340dff1a Style, whitespace 2017-03-02 10:30:04 +01:00
cacaodevandGitHub 5c71612e34 Typo 2017-02-10 20:01:57 +01:00
cacaodev 947d552509 Fix merging 2016-11-07 22:57:33 +01:00
cacaodev 410ad0dc09 Style: print debug logs in debug mode only 2016-11-07 22:26:29 +01:00
Didier Korthoudtandcacaodev eeea21c882 Fixed: CPViewAnimator was not giving correct frame information (#2502)
Fixed: When only animating frameSize, there’s no matrix defined. This is now
correctly handled.
New: The animator can explicitly request frames updates when the frameOrigin 
keyPath changes with the new method [animator setWantsPeriodicFramesUpdates:YES]
2016-11-07 22:20:55 +01:00
cacaodev 82ce626d8a Underscore prefix on private methods 2016-06-12 10:52:19 +02:00
cacaodev fca2746a82 Fixed: custom layout and custom drawing was not animated
The bug was appearing with the following conditions:
keypath : frame , frameSize
browsers : Google Chrome, Firefox
2016-06-12 10:12:08 +02:00
cacaodev 7faffc2de7 Use cancelAnimationFrame when available 2016-06-12 10:12:07 +02:00
cacaodev 86a8a9dc85 Fixed: The animation was reverting back to its initial position.
Although the fill-mode property was correctly set to forwards allowing
the final state to persist, the animation-name property was deleted too
early . It was causing the animation to be cancelled and the initial
state restored.
2016-06-12 10:12:07 +02:00
cacaodev 01c5cf98df FIXED: Unknown function getPropertyCSSValue in Chrome
getPropertyCSSValue have been deprecated in chrome. Replacing with
getPropertyValue supported by all browsers.
2016-04-23 10:54:22 +02:00
cacaodev 0cf54a6a03 Fix a 'duplicate class' build error 2015-05-11 10:31:27 +02:00
cacaodev 50a53181dc Merge remote-tracking branch 'origin/CPAnimationContext' into CPAnimationContext
Conflicts:
	AppKit/CoreAnimation/CPViewAnimator.j
	Tests/Manual/CPAnimatablePropertyContainerTest/Resources/MainMenu.cib
	Tests/Manual/CPAnimatablePropertyContainerTest/Resources/MainMenu.xib
2015-03-14 21:31:12 +01:00
cacaodev e9ae8063db Allow nil completionFunction and fix fallback == nil 2015-03-13 18:52:05 +01:00
cacaodev 82fcf08d84 Rename 2015-03-08 21:52:42 +01:00
cacaodev b951624ed3 Merge remote-tracking branch 'origin/CPAnimationContext' into CPAnimationContext
Conflicts:
	AppKit/CoreAnimation/CPAnimationContext.j
	AppKit/CoreAnimation/CPViewAnimator.j
2015-03-07 20:03:05 +01:00
cacaodev 1b21f2d1c7 CPView (Animation) : simplified CSS_DESCRIPTORS.
Now easiest to subclass and not much more verbose.
CPVIEW_PROPERTIES_DESCRIPTOR is, for a given CPView subclass, the
mapping between animated keypaths and css properties and between
animated values and css values.
2015-03-07 19:51:13 +01:00
cacaodev 43ea0effa2 Replace objj FrameUpdater with a js function.
Also uses the native function window.requestAnimationFrame();
Expected improvement: the effective redraws should now happen only when
needed.
browser support = same as css animations.
2015-03-07 19:45:06 +01:00
cacaodev 6df9b95dea Code style. NEW CPView -DOMElementForKeyPath:keyPath:
-DOMElementForKeyPath:keyPath returns the DOMElement animated by the
css Animation. This allow for an element different from the view
_DOMElement to be animated.
2015-03-07 19:38:48 +01:00
cacaodev 80c8dcacb3 Code Style 2015-02-02 20:15:44 +01:00
cacaodev 3f9e2d5d39 CPAnimationContext : add typedef for HashTable 2014-12-09 22:36:37 +01:00
cacaodev e5d883f97e CAKeyframeAnimation
CPAnimatablePropertyContainer protocol (CPView)
CPAnimationContext
_CPObjectAnimator CPViewAnimator
CSS Animations wrapper

CPAnimatablePropertyContainerTest : animations of views with custom Layout / Regular Layout / Custom DrawRect: / No DrawRect: / Subviews / No Subviews and combinations of these situations.
controls animation (text field, button, popup, slider ...). They animate their size via their action.
2013-04-13 16:29:43 +02:00