From 6933dda0c49cf30e7ccbb791defd2bc6951be27c Mon Sep 17 00:00:00 2001 From: AnthonyGy Date: Mon, 18 Apr 2022 17:18:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=88=87=E5=9C=86=E8=A7=92?= =?UTF-8?q?=20=E6=96=B9=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/AGExtension/AG_Layer_Extension.swift | 28 +++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/Sources/AGExtension/AG_Layer_Extension.swift b/Sources/AGExtension/AG_Layer_Extension.swift index 3accfbc..0eec4f4 100644 --- a/Sources/AGExtension/AG_Layer_Extension.swift +++ b/Sources/AGExtension/AG_Layer_Extension.swift @@ -91,23 +91,49 @@ public extension CALayer { // MARK: -----//// 拓展 CACornerMask 方便设置 方向\\\\----- public extension CACornerMask { + /// 左上 static let leftTop = CACornerMask.layerMinXMinYCorner - + /// 右上 static let rightTop = CACornerMask.layerMaxXMinYCorner + /// 左下 static let leftBottom = CACornerMask.layerMinXMaxYCorner + /// 右下 static let rightBottom = CACornerMask.layerMaxXMaxYCorner + /// 四个角 static let all: CACornerMask = [.leftTop, .rightTop, .leftBottom, .rightBottom] + /// 两个上 static let bothTop: CACornerMask = [.leftTop, .rightTop] + /// 两个下 static let bothBottom: CACornerMask = [.leftBottom, .rightBottom] + /// 两个左 static let bothLeft: CACornerMask = [.leftTop, .leftBottom] + /// 两个右 static let bothRight: CACornerMask = [.rightTop, .rightBottom] + + ///左上右下 + static let topLeftBottomRight: CACornerMask = [.leftTop,.rightBottom] + + /// 右上左下 + static let topRightBottomLeft: CACornerMask = [.rightTop,.leftBottom] + + /// 两个上一个左下 + static let twoTopLeftBottom: CACornerMask = [.bothTop,.leftBottom] + + /// 两个上一个右下 + static let twoTopRightBottom: CACornerMask = [.bothTop,.rightBottom] + + /// 两个下一个左上 + static let twoBottomLeftTop: CACornerMask = [ .bothBottom ,.leftTop] + + /// 两个下一个右上 + static let twoBottomRightTop: CACornerMask = [ .bothBottom ,.rightTop] }