mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-16 05:02:34 +00:00
Fixed elements in a Flow container not positioned correctly after the first wrap
This commit is contained in:
@@ -182,7 +182,7 @@ module CyberarmEngine
|
|||||||
element.y = element.style.margin_top + @current_position.y
|
element.y = element.style.margin_top + @current_position.y
|
||||||
|
|
||||||
@current_position.x += element.outer_width
|
@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
|
end
|
||||||
|
|
||||||
def tallest_neighbor(querier, _y_position) # Flow
|
def tallest_neighbor(querier, _y_position) # Flow
|
||||||
@@ -195,14 +195,14 @@ module CyberarmEngine
|
|||||||
response
|
response
|
||||||
end
|
end
|
||||||
|
|
||||||
def position_on_next_line(child) # Flow
|
def position_on_next_line(element) # Flow
|
||||||
@current_position.x = @style.margin_left
|
@current_position.x = @style.margin_left + @style.padding_left
|
||||||
@current_position.y += tallest_neighbor(child, @current_position.y).outer_height
|
@current_position.y += tallest_neighbor(element, @current_position.y).outer_height
|
||||||
|
|
||||||
child.x = child.style.margin_left + @current_position.x
|
element.x = element.style.margin_left + @current_position.x
|
||||||
child.y = child.style.margin_top + @current_position.y
|
element.y = element.style.margin_top + @current_position.y
|
||||||
|
|
||||||
@current_position.x += child.outer_width
|
@current_position.x += element.outer_width
|
||||||
end
|
end
|
||||||
|
|
||||||
def move_to_next_line(element) # Stack
|
def move_to_next_line(element) # Stack
|
||||||
|
|||||||
Reference in New Issue
Block a user