Fixed elements in a Flow container not positioned correctly after the first wrap

This commit is contained in:
2022-06-12 11:36:22 -05:00
parent 94a65f447c
commit 705138f7ad

View File

@@ -182,7 +182,7 @@ module CyberarmEngine
element.y = element.style.margin_top + @current_position.y
@current_position.x += element.outer_width
@current_position.x = @style.margin_left if @current_position.x >= max_width
@current_position.x = @style.margin_left + @style.padding_left if @current_position.x >= max_width
end
def tallest_neighbor(querier, _y_position) # Flow
@@ -195,14 +195,14 @@ module CyberarmEngine
response
end
def position_on_next_line(child) # Flow
@current_position.x = @style.margin_left
@current_position.y += tallest_neighbor(child, @current_position.y).outer_height
def position_on_next_line(element) # Flow
@current_position.x = @style.margin_left + @style.padding_left
@current_position.y += tallest_neighbor(element, @current_position.y).outer_height
child.x = child.style.margin_left + @current_position.x
child.y = child.style.margin_top + @current_position.y
element.x = element.style.margin_left + @current_position.x
element.y = element.style.margin_top + @current_position.y
@current_position.x += child.outer_width
@current_position.x += element.outer_width
end
def move_to_next_line(element) # Stack