Commit a9b489a0 by Daniel Dahan

fixed issue where MaterialLayer would break when initializing with an empty layer.

parent 55817cd7
......@@ -548,7 +548,7 @@ public class ImageCardView : MaterialPulseView {
if nil == imageLayer {
imageLayer = CAShapeLayer()
imageLayer!.masksToBounds = true
imageLayer!.zPosition = -1
imageLayer!.zPosition = 0
visualLayer.addSublayer(imageLayer!)
}
}
......
......@@ -458,7 +458,7 @@ public class MaterialButton : UIButton {
// :name: prepareVisualLayer
//
internal func prepareVisualLayer() {
visualLayer.zPosition = -1
visualLayer.zPosition = 0
visualLayer.masksToBounds = true
layer.addSublayer(visualLayer)
}
......
......@@ -187,7 +187,7 @@ public class MaterialLayer : CAShapeLayer {
shape = .None
shadowDepth = .None
super.init(coder: aDecoder)
prepareLayer()
prepareVisualLayer()
}
/**
......@@ -196,8 +196,8 @@ public class MaterialLayer : CAShapeLayer {
public override init(layer: AnyObject) {
shape = .None
shadowDepth = .None
super.init(layer: layer)
prepareLayer()
super.init()
prepareVisualLayer()
}
/**
......@@ -207,7 +207,7 @@ public class MaterialLayer : CAShapeLayer {
shape = .None
shadowDepth = .None
super.init()
prepareLayer()
prepareVisualLayer()
}
/**
......@@ -269,12 +269,12 @@ public class MaterialLayer : CAShapeLayer {
}
/**
:name: prepareLayer
:name: prepareVisualLayer
*/
public func prepareLayer() {
public func prepareVisualLayer() {
// visualLayer
visualLayer.zPosition = 0
visualLayer.masksToBounds = true
visualLayer.zPosition = -1
addSublayer(visualLayer)
}
......
......@@ -397,7 +397,7 @@ public class MaterialView : UIView {
// :name: prepareVisualLayer
//
internal func prepareVisualLayer() {
visualLayer.zPosition = -1
visualLayer.zPosition = 0
visualLayer.masksToBounds = true
layer.addSublayer(visualLayer)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment