Skip to content

Commit

Permalink
fix contentsRect & contentsScale animation
Browse files Browse the repository at this point in the history
  • Loading branch information
lkzhao committed Feb 25, 2017
1 parent 94d4b83 commit abdddd0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/HeroCoreAnimationViewContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,11 @@ internal class HeroCoreAnimationViewContext: HeroAnimatorViewContext {
getOverlayLayer().add(anim, forKey: overlayKey)
} else {
snapshot.layer.add(anim, forKey: key)
if key == "cornerRadius" {
switch key {
case "cornerRadius", "contentsRect", "contentsScale":
contentLayer?.add(anim, forKey: key)
overlayLayer?.add(anim, forKey: key)
} else if key == "bounds.size" {
case "bounds.size":
let fromSize = (fromValue as? NSValue)!.cgSizeValue
let toSize = (toValue as? NSValue)!.cgSizeValue

Expand All @@ -155,6 +156,7 @@ internal class HeroCoreAnimationViewContext: HeroAnimatorViewContext {

overlayLayer?.add(positionAnim, forKey: "position")
overlayLayer?.add(anim, forKey: key)
default: break
}
}

Expand Down

0 comments on commit abdddd0

Please sign in to comment.