From 7f972f66bf899c7f83d7eec0b2c9aff6e1592ecc Mon Sep 17 00:00:00 2001 From: iWw Date: Wed, 10 Aug 2022 11:31:06 +0800 Subject: [PATCH] fix *WrapperView render image with backgroundColor --- Sources/StackKit/HStackLayerWrapperView.swift | 3 +-- Sources/StackKit/VStackLayerWrapperView.swift | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Sources/StackKit/HStackLayerWrapperView.swift b/Sources/StackKit/HStackLayerWrapperView.swift index b3de12e..ac9f338 100644 --- a/Sources/StackKit/HStackLayerWrapperView.swift +++ b/Sources/StackKit/HStackLayerWrapperView.swift @@ -73,7 +73,7 @@ open class HStackLayerWrapperView: UIView { let imageLayer = CALayer() imageLayer.contents = subview.layer.contents imageLayer.bounds = subview.layer.bounds - imageLayer.backgroundColor = subview.layer.backgroundColor + imageLayer.backgroundColor = subview.backgroundColor?.cgColor layer.addSublayer(imageLayer) return } @@ -103,7 +103,6 @@ open class HStackLayerWrapperView: UIView { let tempLayer = CALayer() tempLayer.contents = image.cgImage tempLayer.bounds = subview.bounds - tempLayer.backgroundColor = subview.backgroundColor?.cgColor layer.addSublayer(tempLayer) } diff --git a/Sources/StackKit/VStackLayerWrapperView.swift b/Sources/StackKit/VStackLayerWrapperView.swift index 4002d31..6086ca8 100644 --- a/Sources/StackKit/VStackLayerWrapperView.swift +++ b/Sources/StackKit/VStackLayerWrapperView.swift @@ -73,7 +73,7 @@ open class VStackLayerWrapperView: UIView { let imageLayer = CALayer() imageLayer.contents = subview.layer.contents imageLayer.bounds = subview.layer.bounds - imageLayer.backgroundColor = subview.layer.backgroundColor + imageLayer.backgroundColor = subview.backgroundColor?.cgColor layer.addSublayer(imageLayer) return } @@ -103,7 +103,6 @@ open class VStackLayerWrapperView: UIView { let tempLayer = CALayer() tempLayer.contents = image.cgImage tempLayer.bounds = subview.bounds - tempLayer.backgroundColor = subview.backgroundColor?.cgColor layer.addSublayer(tempLayer) }