Skip to content

Commit

Permalink
[layout] remove deprecated method
Browse files Browse the repository at this point in the history
  • Loading branch information
honghaoz committed Aug 27, 2024
1 parent dbaf8c0 commit c84755c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,14 +340,6 @@ public extension CGSize {
func roundedUp() -> CGSize {
CGSize(ceil(width), ceil(height))
}

// TODO: Remove this.
@available(*, deprecated, message: "Use `roundedUp(scaleFactor:)` instead.")
@inlinable
@inline(__always)
var integral: CGSize {
CGRect(origin: .zero, size: self).integral.size
}
}

public extension CGSize {
Expand Down
8 changes: 4 additions & 4 deletions Tests/ChouTiUITests/Universal/Layout/LayoutTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -313,22 +313,22 @@ class LayoutTests: XCTestCase {

// when anchor is customized
do {
let frame = Layout.anchor(rect: childSize, relativeTo: CGRect(origin: .zero, size: containerSize), edge: .top, anchorPoint: .init(x: 0.1, y: 0.2), gap: 13)
let frame = Layout.anchor(rect: childSize, relativeTo: CGRect(origin: .zero, size: containerSize), edge: .top, anchorPoint: UnitPoint(x: 0.1, y: 0.2), gap: 13)
expect(frame) == CGRect(x: -20, y: -213, width: 100, height: 200)
}

do {
let frame = Layout.anchor(rect: childSize, relativeTo: CGRect(origin: .zero, size: containerSize), edge: .left, anchorPoint: .init(x: 0.1, y: 0.2), gap: 13)
let frame = Layout.anchor(rect: childSize, relativeTo: CGRect(origin: .zero, size: containerSize), edge: .left, anchorPoint: UnitPoint(x: 0.1, y: 0.2), gap: 13)
expect(frame) == CGRect(x: -113, y: 0, width: 100, height: 200)
}

do {
let frame = Layout.anchor(rect: childSize, relativeTo: CGRect(origin: .zero, size: containerSize), edge: .bottom, anchorPoint: .init(x: 0.1, y: 0.2), gap: 13)
let frame = Layout.anchor(rect: childSize, relativeTo: CGRect(origin: .zero, size: containerSize), edge: .bottom, anchorPoint: UnitPoint(x: 0.1, y: 0.2), gap: 13)
expect(frame) == CGRect(x: -20, y: 513, width: 100, height: 200)
}

do {
let frame = Layout.anchor(rect: childSize, relativeTo: CGRect(origin: .zero, size: containerSize), edge: .right, anchorPoint: .init(x: 0.1, y: 0.2), gap: 13)
let frame = Layout.anchor(rect: childSize, relativeTo: CGRect(origin: .zero, size: containerSize), edge: .right, anchorPoint: UnitPoint(x: 0.1, y: 0.2), gap: 13)
expect(frame) == CGRect(x: 313, y: 0, width: 100, height: 200)
}
}
Expand Down

0 comments on commit c84755c

Please sign in to comment.