Skip to content

Commit

Permalink
Fix refactor bug
Browse files Browse the repository at this point in the history
  • Loading branch information
eonist committed Oct 1, 2023
1 parent 93fc6a2 commit 6dcf470
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Spatial/align/Align.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public final class Align {
*/
public static func align(object: View, canvasSize: CGSize, canvasAlignment: Alignment, objectAlignment: Alignment, offset: CGPoint = .zero) {
// Calculate the alignment point for the object based on the given parameters
let alignmentPoint: CGPoint = Align.alignmentPoint(objectSize: CGSize(width: object.frame.width, height: object.frame.height), canvasSize: canvasSize, canvasAlignment: canvasAlignment, objectAlignment: objectAlignment, offset: offset)
let alignmentPoint: CGPoint = Align.alignmentPoint(objectSize: CGSize(width: object.frame.width, height: object.frame.height), canvasSize: canvasSize, canvasAlign: canvasAlignment, objectAlign: objectAlignment, offset: offset)

// Update the object's frame origin to the calculated alignment point
object.frame.origin = alignmentPoint
Expand Down Expand Up @@ -91,7 +91,7 @@ extension Align {
// Loop through each object in the array and align it to the specified canvas and object alignments
objects.forEach { object in
// Align the object to the specified canvas and object alignments with the given offset
Align.align(object: object, canvasSize: canvasSize, canvasAlign: canvasAlign, objectAlign: objectAlign, offset: offset)
Align.align(object: object, canvasSize: canvasSize, canvasAlignment: canvasAlign, objectAlignment: objectAlign, offset: offset)
}
}
}
2 changes: 2 additions & 0 deletions Sources/Spatial/view/View+Anchor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public final class Constraint {
multiplier: 1.0, // The multiplier of the constraint.
constant: offset // The offset of the view from the parent view.
)
return constraint
}
/**
* Creates a vertical anchor constraint between the view and the parent view.
Expand Down Expand Up @@ -88,6 +89,7 @@ public final class Constraint {
multiplier: 1.0, // The multiplier of the constraint.
constant: offset // The offset of the view from the parent view.
)
return constraint
}
}
/**
Expand Down

0 comments on commit 6dcf470

Please sign in to comment.