From 1e815c767fba373003da85414532c56ffcd3f169 Mon Sep 17 00:00:00 2001 From: Igor Zapletnev Date: Wed, 3 Aug 2016 12:54:54 +0600 Subject: [PATCH] Mark custom methods as GENERATED NOT --- Source/extensions/Node.swift | 3 +++ Source/model/geom2d/Point.swift | 2 ++ Source/model/geom2d/Rect.swift | 9 +++++---- Source/model/scene/Group.swift | 1 + Source/model/scene/Node.swift | 12 +++++------- Source/model/scene/Shape.swift | 1 + 6 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 Source/extensions/Node.swift diff --git a/Source/extensions/Node.swift b/Source/extensions/Node.swift new file mode 100644 index 00000000..31efc66f --- /dev/null +++ b/Source/extensions/Node.swift @@ -0,0 +1,3 @@ +extension Node { + public var animating = false +} \ No newline at end of file diff --git a/Source/model/geom2d/Point.swift b/Source/model/geom2d/Point.swift index 8ae122ef..eca7af8d 100644 --- a/Source/model/geom2d/Point.swift +++ b/Source/model/geom2d/Point.swift @@ -11,10 +11,12 @@ public class Point: Locus { self.y = y } + // GENERATED NOT public class func zero() -> Point { return Point(x: 0.0, y: 0.0) } + // GENERATED NOT public func add(point: Point) -> Point { return Point( x: self.x + point.x, diff --git a/Source/model/geom2d/Rect.swift b/Source/model/geom2d/Rect.swift index 0f1971c1..faed76af 100644 --- a/Source/model/geom2d/Rect.swift +++ b/Source/model/geom2d/Rect.swift @@ -24,6 +24,11 @@ public class Rect: Locus { return false } + // GENERATED NOT + class func zero() -> Rect { + return Rect(x: 0.0, y: 0.0, w: 0.0, h: 0.0) + } + // GENERATED NOT public func union(rect: Rect) -> Rect { return Rect( @@ -41,8 +46,4 @@ public class Rect: Locus { w: self.w, h: self.h) } - - class func zero() -> Rect { - return Rect(x: 0.0, y: 0.0, w: 0.0, h: 0.0) - } } diff --git a/Source/model/scene/Group.swift b/Source/model/scene/Group.swift index 00071ece..11afb469 100644 --- a/Source/model/scene/Group.swift +++ b/Source/model/scene/Group.swift @@ -16,6 +16,7 @@ public class Group: Node { ) } + // GENERATED NOT override public func bounds() -> Rect? { guard let firstPos = contentsVar.value.first?.pos else { return .None diff --git a/Source/model/scene/Node.swift b/Source/model/scene/Node.swift index 9515afa3..17129944 100644 --- a/Source/model/scene/Node.swift +++ b/Source/model/scene/Node.swift @@ -1,7 +1,7 @@ import Foundation import RxSwift -public class Node: Drawable { +public class Node: Drawable { public let posVar: Variable public var pos: Transform { @@ -26,14 +26,12 @@ public class Node: Drawable { get { return clipVar.value } set(val) { clipVar.value = val } } - - public var animating = false public init(pos: Transform, opaque: NSObject = true, visible: NSObject = true, clip: Locus? = nil, tag: [String] = []) { - self.posVar = Variable(pos) - self.opaqueVar = Variable(opaque) - self.visibleVar = Variable(visible) - self.clipVar = Variable(clip) + self.posVar = Variable(pos) + self.opaqueVar = Variable(opaque) + self.visibleVar = Variable(visible) + self.clipVar = Variable(clip) super.init( tag: tag ) diff --git a/Source/model/scene/Shape.swift b/Source/model/scene/Shape.swift index 6f6495fe..c29b592a 100644 --- a/Source/model/scene/Shape.swift +++ b/Source/model/scene/Shape.swift @@ -34,6 +34,7 @@ public class Shape: Node { ) } + // GENERATED NOT override public func bounds() -> Rect? { // TODO: Implement more form types