@@ -248,15 +248,25 @@ private func putOperation<T: BoxDimension>(_ superview: Layoutable, intentions:
248248
249249 var totalSizeForFlexs = T . getDimension ( bounds) . size
250250
251+
252+ var totalFix : CGFloat = 0.0
253+
251254 for i in intentions {
252255 switch ( i) {
253256 case . flex( _, let weight) :
254257 totalWeight += weight
255258 case . fix( let views, let value) :
256- totalSizeForFlexs -= value. calculateValue ( forViews: views, dimension: dimension)
259+ let v = value. calculateValue ( forViews: views, dimension: dimension)
260+ totalFix += v
261+ totalSizeForFlexs -= v
257262 }
258263 }
259264
265+ if wrapParent {
266+ let dim = T . getDimension ( superview. lx_frame)
267+ superview. lx_frame = T . setDimension ( Dimension ( origin: dim. origin, size: totalFix - dim. origin) , inRect: superview. lx_frame)
268+ }
269+
260270 let unoSize = totalSizeForFlexs/ totalWeight
261271
262272 var start = T . getDimension ( bounds) . origin
@@ -267,7 +277,7 @@ private func putOperation<T: BoxDimension>(_ superview: Layoutable, intentions:
267277 let newSize = weight * unoSize
268278
269279 if let views = views {
270- views. forEach { view in
280+ views. forEach { view in
271281 let fr = view. lx_frame
272282 view. updateFrame ( T . setDimension ( Dimension ( origin: start, size: newSize) , inRect: fr) )
273283 }
@@ -289,10 +299,7 @@ private func putOperation<T: BoxDimension>(_ superview: Layoutable, intentions:
289299 }
290300 }
291301
292- if wrapParent {
293- let dim = T . getDimension ( superview. lx_frame)
294- superview. lx_frame = T . setDimension ( Dimension ( origin: dim. origin, size: start - T. getDimension ( bounds) . origin) , inRect: superview. lx_frame)
295- }
302+
296303}
297304
298305extension Layouting where Base: Layoutable {
0 commit comments