1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-11-11 01:42:35 +03:00

Merge remote-tracking branch 'Macaw/master' into task/svgViewBox

This commit is contained in:
Alisa Mylnikova 2018-04-05 18:23:55 +07:00
commit 52c7740f94
7 changed files with 5 additions and 50 deletions

View File

@ -105,7 +105,6 @@
57614B551F83D15600875933 /* Common_iOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = A718CD431F45C28200966E06 /* Common_iOS.swift */; };
57614B561F83D15600875933 /* Common_macOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = A718CD491F45C28F00966E06 /* Common_macOS.swift */; };
57614B571F83D15600875933 /* MDisplayLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57F108791F53C92000DC365B /* MDisplayLink.swift */; };
57614B581F83D15600875933 /* AnimationRestorer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57E5E0F81E3B393900D1CB28 /* AnimationRestorer.swift */; };
57614B591F83D15600875933 /* Event.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57E5E10A1E3B393900D1CB28 /* Event.swift */; };
57614B5A1F83D15600875933 /* Gradient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57E5E11C1E3B393900D1CB28 /* Gradient.swift */; };
57614B5B1F83D15600875933 /* Interpolable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57E5E0EE1E3B393900D1CB28 /* Interpolable.swift */; };
@ -170,7 +169,6 @@
57E5E1611E3B393900D1CB28 /* PathBounds.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57E5E0F21E3B393900D1CB28 /* PathBounds.swift */; };
57E5E1621E3B393900D1CB28 /* PathFunctions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57E5E0F31E3B393900D1CB28 /* PathFunctions.swift */; };
57E5E1631E3B393900D1CB28 /* AnimationCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57E5E0F71E3B393900D1CB28 /* AnimationCache.swift */; };
57E5E1641E3B393900D1CB28 /* AnimationRestorer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57E5E0F81E3B393900D1CB28 /* AnimationRestorer.swift */; };
57E5E1651E3B393900D1CB28 /* NodeHashable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57E5E0F91E3B393900D1CB28 /* NodeHashable.swift */; };
57E5E1661E3B393900D1CB28 /* TransformHashable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57E5E0FA1E3B393900D1CB28 /* TransformHashable.swift */; };
57E5E1671E3B393900D1CB28 /* MorphingGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57E5E0FB1E3B393900D1CB28 /* MorphingGenerator.swift */; };
@ -368,7 +366,6 @@
57E5E0F21E3B393900D1CB28 /* PathBounds.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PathBounds.swift; sourceTree = "<group>"; };
57E5E0F31E3B393900D1CB28 /* PathFunctions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PathFunctions.swift; sourceTree = "<group>"; };
57E5E0F71E3B393900D1CB28 /* AnimationCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimationCache.swift; sourceTree = "<group>"; };
57E5E0F81E3B393900D1CB28 /* AnimationRestorer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimationRestorer.swift; sourceTree = "<group>"; };
57E5E0F91E3B393900D1CB28 /* NodeHashable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NodeHashable.swift; sourceTree = "<group>"; };
57E5E0FA1E3B393900D1CB28 /* TransformHashable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransformHashable.swift; sourceTree = "<group>"; };
57E5E0FB1E3B393900D1CB28 /* MorphingGenerator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MorphingGenerator.swift; sourceTree = "<group>"; };
@ -683,7 +680,6 @@
isa = PBXGroup;
children = (
57E5E0F71E3B393900D1CB28 /* AnimationCache.swift */,
57E5E0F81E3B393900D1CB28 /* AnimationRestorer.swift */,
57E5E0F91E3B393900D1CB28 /* NodeHashable.swift */,
57E5E0FA1E3B393900D1CB28 /* TransformHashable.swift */,
);
@ -1232,7 +1228,6 @@
57614B551F83D15600875933 /* Common_iOS.swift in Sources */,
57614B561F83D15600875933 /* Common_macOS.swift in Sources */,
57614B571F83D15600875933 /* MDisplayLink.swift in Sources */,
57614B581F83D15600875933 /* AnimationRestorer.swift in Sources */,
57614B591F83D15600875933 /* Event.swift in Sources */,
57614B5A1F83D15600875933 /* Gradient.swift in Sources */,
57614B5B1F83D15600875933 /* Interpolable.swift in Sources */,
@ -1359,7 +1354,6 @@
A718CD441F45C28200966E06 /* Common_iOS.swift in Sources */,
A718CD4D1F45C28F00966E06 /* Common_macOS.swift in Sources */,
57F1087A1F53C92000DC365B /* MDisplayLink.swift in Sources */,
57E5E1641E3B393900D1CB28 /* AnimationRestorer.swift in Sources */,
57E5E1741E3B393900D1CB28 /* Event.swift in Sources */,
57E5E1841E3B393900D1CB28 /* Gradient.swift in Sources */,
57E5E15D1E3B393900D1CB28 /* Interpolable.swift in Sources */,

View File

@ -1,24 +0,0 @@
import Foundation
let animationRestorer = AnimationRestorer()
open class AnimationRestorer {
typealias RestoreClosure = () -> Void
var restoreClosures = [RestoreClosure]()
func addRestoreClosure(_ closure: @escaping RestoreClosure) {
restoreClosures.append(closure)
}
open class func restore() {
DispatchQueue.main.async {
animationRestorer.restoreClosures.forEach { restoreClosure in
restoreClosure()
}
animationRestorer.restoreClosures.removeAll()
}
}
}

View File

@ -64,11 +64,6 @@ func addMorphingAnimation(_ animation: BasicAnimation, sceneLayer: CALayer, anim
animation.completion?()
}
if !finished {
animationRestorer.addRestoreClosure(completion)
return
}
completion()
}

View File

@ -46,11 +46,6 @@ func addOpacityAnimation(_ animation: BasicAnimation, sceneLayer: CALayer, anima
animation.completion?()
}
if !finished {
animationRestorer.addRestoreClosure(completion)
return
}
completion()
}

View File

@ -69,11 +69,6 @@ func addShapeAnimation(_ animation: BasicAnimation, sceneLayer: CALayer, animati
animation.completion?()
}
if !finished {
animationRestorer.addRestoreClosure(completion)
return
}
completion()
}

View File

@ -54,11 +54,6 @@ func addTransformAnimation(_ animation: BasicAnimation, sceneLayer: CALayer, ani
animation.completion?()
}
if !finished {
animationRestorer.addRestoreClosure(completion)
return
}
completion()
}

View File

@ -168,6 +168,11 @@ open class MacawView: MView, MGestureRecognizerDelegate {
}
MGraphicsEndImageContext()
}
public final func findNodeAt(location: CGPoint) -> Node? {
guard let ctx = context.cgContext else { return .none }
return renderer?.findNodeAt(location: location, ctx: ctx)
}
// MARK: - Touches