From 773ad79c98d412a0237d242ceec4a9ed9312014f Mon Sep 17 00:00:00 2001 From: eonist <30n1st@gmail.com> Date: Fri, 22 Sep 2023 03:39:45 +0200 Subject: [PATCH] Update AlignType+Extension.swift --- .../align/AlignType/AlignType+Extension.swift | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Sources/Spatial/align/AlignType/AlignType+Extension.swift b/Sources/Spatial/align/AlignType/AlignType+Extension.swift index 9d95ae4..46d9866 100644 --- a/Sources/Spatial/align/AlignType/AlignType+Extension.swift +++ b/Sources/Spatial/align/AlignType/AlignType+Extension.swift @@ -4,21 +4,28 @@ import Foundation */ extension AlignType { /** - * - Fixme: ⚠️️ add doc - */ + * Extension to `AlignType` enum to provide a computed property for the axis type. + * Returns the axis type (horizontal or vertical) based on the alignment type. + */ public var axis: Axis { switch self { + // If the alignment is top, bottom, or center vertical, return vertical alignment case .top, .bottom, .centerVer: return .ver + // If the alignment is left, right, or center horizontal, return horizontal alignment case .left, .right, .centerHor: return .hor } } /** - * - Fixme: ⚠️️ add doc - */ + * Extension to `AlignType` enum to provide a computed property for the axis type. + * Returns the axis type (start, middle, or end) based on the alignment type. + */ public var axisType: AxisType { switch self { + // If the alignment is top or left, return start alignment case .top, .left: return .start + // If the alignment is center horizontal or center vertical, return middle alignment case .centerHor, .centerVer: return .middle + // If the alignment is bottom or right, return end alignment case .bottom, .right: return .end } }