mirror of
				https://github.com/nicbarker/clay.git
				synced 2025-11-04 08:36:17 +00:00 
			
		
		
		
	[Core] Fix layout bug in SIZING_PERCENT
This commit is contained in:
		
							parent
							
								
									16f894bb4d
								
							
						
					
					
						commit
						81589ad29b
					
				
							
								
								
									
										9
									
								
								clay.h
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								clay.h
									
									
									
									
									
								
							| 
						 | 
					@ -2257,12 +2257,6 @@ void Clay__SizeContainersAlongAxis(bool xAxis) {
 | 
				
			||||||
                    *childSize = (parentSize - totalPaddingAndChildGaps) * childSizing.size.percent;
 | 
					                    *childSize = (parentSize - totalPaddingAndChildGaps) * childSizing.size.percent;
 | 
				
			||||||
                    if (sizingAlongAxis) {
 | 
					                    if (sizingAlongAxis) {
 | 
				
			||||||
                        innerContentSize += *childSize;
 | 
					                        innerContentSize += *childSize;
 | 
				
			||||||
                        if (childOffset > 0) {
 | 
					 | 
				
			||||||
                            innerContentSize += parentChildGap; // For children after index 0, the childAxisOffset is the gap from the previous child
 | 
					 | 
				
			||||||
                            totalPaddingAndChildGaps += parentChildGap;
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    } else {
 | 
					 | 
				
			||||||
                        innerContentSize = CLAY__MAX(*childSize, innerContentSize);
 | 
					 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -2483,9 +2477,6 @@ void Clay__CalculateFinalLayout() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // DFS node has been visited, this is on the way back up to the root
 | 
					        // DFS node has been visited, this is on the way back up to the root
 | 
				
			||||||
        Clay_LayoutConfig *layoutConfig = currentElement->layoutConfig;
 | 
					        Clay_LayoutConfig *layoutConfig = currentElement->layoutConfig;
 | 
				
			||||||
        if (layoutConfig->sizing.height.type == CLAY__SIZING_TYPE_PERCENT) {
 | 
					 | 
				
			||||||
            continue;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        if (layoutConfig->layoutDirection == CLAY_LEFT_TO_RIGHT) {
 | 
					        if (layoutConfig->layoutDirection == CLAY_LEFT_TO_RIGHT) {
 | 
				
			||||||
            // Resize any parent containers that have grown in height along their non layout axis
 | 
					            // Resize any parent containers that have grown in height along their non layout axis
 | 
				
			||||||
            for (int32_t j = 0; j < currentElement->childrenOrTextContent.children.length; ++j) {
 | 
					            for (int32_t j = 0; j < currentElement->childrenOrTextContent.children.length; ++j) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue