Skip to content

Commit 222b4fd

Browse files
authored
Merge branch 'master' into enhance-swift-package
2 parents 8c5177d + c564935 commit 222b4fd

File tree

6 files changed

+33
-23
lines changed

6 files changed

+33
-23
lines changed

.github/workflows/github-actions-ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ jobs:
1212
- run: bundle install
1313
- run: pod install --repo-update
1414

15-
- name: Set Xcode Version 13.2.1
16-
run: sudo xcode-select -s /Applications/Xcode_13.2.1.app
17-
1815
- name: fastlane
1916
run: set -o pipefail && bundle exec fastlane travis
2017

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77

88
# Change Log
99

10+
## [2.0.03](https://github.com/layoutBox/FlexLayout/releases/tag/2.0.03)
11+
Released on 2023-10-15
12+
13+
#### Fix crashes that occurs when the node's topLeft position is nan
14+
15+
Added by [OhKanghoon](https://github.com/OhKanghoon) in Pull Request [#230](https://github.com/layoutBox/FlexLayout/pull/234)
16+
17+
1018
## [2.0.01](https://github.com/layoutBox/FlexLayout/releases/tag/2.0.01)
1119
Released on 2023-10-01
1220

FlexLayout.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Pod::Spec.new do |spec|
33
spec.name = "FlexLayout"
4-
spec.version = "2.0.02"
4+
spec.version = "2.0.03"
55
spec.summary = "FlexLayout"
66
spec.homepage = "https://github.com/lucdion/FlexLayout.git"
77
spec.license = "MIT license"

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ Another possible solution:
409409
### layout()
410410
- Applies to: `flex containers`
411411
- Values: `fitContainer` / `adjustWidth` / `adjustHeight`
412-
- Default value: `fitContainer `
412+
- Default value: `fitContainer`
413413

414414
**Method:**
415415

@@ -419,8 +419,8 @@ The method will layout the flex container's children.
419419
Layout modes:
420420

421421
* **`fitContainer`**: This is the default mode when no parameter is specified. Children are layouted **inside** the container's size (width and height).
422-
* **`adjustHeight `**: In this mode, children are layouted **using only the container's width**. The container's height will be adjusted to fit the flexbox's children
423-
* **`adjustWidth `**: In this mode, children are layouted **using only the container's height**. The container's width will be adjusted to fit the flexbox's children
422+
* **`adjustHeight`**: In this mode, children are layouted **using only the container's width**. The container's height will be adjusted to fit the flexbox's children
423+
* **`adjustWidth`**: In this mode, children are layouted **using only the container's height**. The container's width will be adjusted to fit the flexbox's children
424424

425425
###### Usage examples:
426426
```swift
@@ -513,7 +513,7 @@ The `justifyContent` property defines the alignment along the main-axis of the c
513513
### alignItems()
514514
- Applies to: `flex containers`
515515
- Values: `stretch` / `start` / `end` / `center` / `baseline`
516-
- Default value: `stretch `
516+
- Default value: `stretch`
517517
- CSS name: `align-items`
518518

519519
**Method:**
@@ -662,7 +662,7 @@ It specifies the "flex shrink factor", which determines how much the flex item w
662662
<br>
663663

664664
### basis
665-
- Applies to: `flex items `
665+
- Applies to: `flex items`
666666
- Default value: 0
667667
- CSS name: `flex-basis`
668668

Sources/YogaKit/YGLayout.mm

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,18 @@ static CGFloat YGRoundPixelValue(CGFloat value) {
517517
return roundf(value * scale) / scale;
518518
}
519519

520+
static CGPoint YGPointReplacingNanWithZero(CGPoint const value) {
521+
CGPoint result = value;
522+
523+
if (isnan(result.x)) {
524+
result.x = 0;
525+
}
526+
if (isnan(result.y)) {
527+
result.y = 0;
528+
}
529+
return result;
530+
}
531+
520532
static void YGApplyLayoutToViewHierarchy(UIView* view, BOOL preserveOrigin) {
521533
NSCAssert(
522534
[NSThread isMainThread],
@@ -529,22 +541,15 @@ static void YGApplyLayoutToViewHierarchy(UIView* view, BOOL preserveOrigin) {
529541
}
530542

531543
YGNodeRef node = yoga.node;
532-
const CGPoint topLeft = {
544+
const CGPoint topLeft = YGPointReplacingNanWithZero({
533545
YGNodeLayoutGetLeft(node),
534546
YGNodeLayoutGetTop(node),
535-
};
547+
});
536548

537-
CGPoint bottomRight = {
549+
const CGPoint bottomRight = YGPointReplacingNanWithZero({
538550
topLeft.x + YGNodeLayoutGetWidth(node),
539551
topLeft.y + YGNodeLayoutGetHeight(node),
540-
};
541-
542-
if (isnan(bottomRight.x)) {
543-
bottomRight.x = 0;
544-
}
545-
if (isnan(bottomRight.y)) {
546-
bottomRight.y = 0;
547-
}
552+
});
548553

549554
const CGPoint origin = preserveOrigin ? view.frame.origin : CGPointZero;
550555
view.frame = (CGRect){

fastlane/Fastfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ platform :ios do
4747
configuration: "Release",
4848
build: true,
4949
clean: true,
50-
destination: "platform=iOS Simulator,name=iPhone 8,OS=15.2"
50+
destination: "platform=iOS Simulator,name=iPhone 14,OS=16.2"
5151
)
5252

5353
#xcodebuild(
@@ -56,7 +56,7 @@ platform :ios do
5656
# configuration: "Release",
5757
# build: true,
5858
# clean: true
59-
# destination: "platform=iOS Simulator,name=iPhone X,OS=15.2"
59+
# destination: "platform=iOS Simulator,name=iPhone 14,OS=16.2"
6060
#)
6161

6262
xcodebuild(
@@ -65,7 +65,7 @@ platform :ios do
6565
configuration: "Release",
6666
build: true,
6767
clean: true,
68-
destination: "platform=iOS Simulator,name=iPhone 8,OS=15.2"
68+
destination: "platform=iOS Simulator,name=iPhone 14,OS=16.2"
6969
)
7070
end
7171

0 commit comments

Comments
 (0)