             var w = CGFloat(0)
             var h = CGFloat(0)
             for i in 0..<subviews.count {
-                let sz1 = subviews[i].sizeThatFits(sz)
+                let sz1 = subviews[i].hidden ? CGSize.zero : subviews[i].sizeThatFits(sz)
                 w = max(sz1.width, w)
                 h += sz1.height
             }

                let fsz = v.sizeThatFits(fit)
                let w = fsz.width
                let p1 = {
                    switch p {
                    case .rigid:    return SilentBoxPartition.rigid(length: w)
                    case .soft:     return SilentBoxPartition.soft(proportion: w)
                    }
                }() as SilentBoxPartition
                ps1.append(p1)


/// By default, all subviews will be treated as `rigid` box.
/// If you want to put a `soft` box, you have to use a `setPartitionMode` function.
/// 
/// Excludes hidden views from layout calculation.
public class DivisionView: UIView {
    private var partitionModeForSubviews = [DivisionViewPartitionMode]()
    public var axis = DivisionViewAxis.vertical {
        didSet {
            setNeedsLayout()
        }
    }
    public var alignment = DivisionAlignment.center {
        didSet {
            setNeedsLayout()
        }
    }

    private func getIndexOfSubview(subview: UIView) -> Int {
        guard let index = subviews.indexOf(subview) else { fatalError("The subview could not be found in `subviews` array.") }
