Skip to content

Commit

Permalink
Fixed Grid issues, where the layout calculations were being deferred …
Browse files Browse the repository at this point in the history
…and causing inconsistencies in layouts.
  • Loading branch information
Daniel Dahan committed Sep 11, 2019
1 parent 3124322 commit 0858e5f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 3.1.7

* Fixed Grid issues, where the layout calculations were being deferred and causing inconsistencies in layouts.
* Updated to [Motion 3.1.2](https://github.com/CosmicMind/Motion/releases/tag/3.1.2).

## 3.1.6
- [issue-1245](https://github.com/CosmicMind/Material/issues/1245): Fixed issue where completion block was not executed when calling Switch.toggle.

Expand Down
2 changes: 1 addition & 1 deletion Material.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Material'
s.version = '3.1.6'
s.version = '3.1.7'
s.swift_version = '5.0'
s.license = 'BSD-3-Clause'
s.summary = 'A UI/UX framework for creating beautiful applications.'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1030"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Sources/Frameworks/Motion
2 changes: 1 addition & 1 deletion Sources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.1.6</string>
<string>3.1.7</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
7 changes: 7 additions & 0 deletions Sources/iOS/Grid/Grid.swift
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@ public struct Grid {
return
}

/// It is important to call `setNeedsLayout` and `layoutIfNeeded`
/// in order to have the parent view's `frame` calculation be set
/// for `Grid` to be able to then calculate the correct dimenions
/// of its `child` views.
canvas.setNeedsLayout()
canvas.layoutIfNeeded()

guard 0 < canvas.bounds.width && 0 < canvas.bounds.height else {
return
}
Expand Down

0 comments on commit 0858e5f

Please sign in to comment.