mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2026-09-19 13:23:48 +00:00
Fixed flow containers not correctly positioning their children on the x axis when they wrap to the the next line, fix up containers vertical and horizontal alignment
This commit is contained in:
@@ -203,9 +203,9 @@ module CyberarmEngine
|
|||||||
|
|
||||||
case styled(:v_align)
|
case styled(:v_align)
|
||||||
when :center
|
when :center
|
||||||
@y = parent.y + parent.styled(:margin_top) + parent.height / 2 - height / 2
|
@y = parent.y + parent.outer_height / 2 - outer_height / 2
|
||||||
when :bottom
|
when :bottom
|
||||||
@y = parent.y + parent.styled(:margin_top) + parent.height - height
|
@y = parent.y + parent.outer_height - outer_height
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -214,9 +214,9 @@ module CyberarmEngine
|
|||||||
|
|
||||||
case styled(:h_align)
|
case styled(:h_align)
|
||||||
when :center
|
when :center
|
||||||
@x = parent.x + parent.styled(:margin_left) + parent.width / 2 - width / 2
|
@x = parent.x + parent.outer_width / 2 - outer_width / 2
|
||||||
when :right
|
when :right
|
||||||
@x = parent.x + parent.styled(:margin_left) + parent.width - width
|
@x = parent.x + parent.outer_width - outer_width
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -285,7 +285,7 @@ module CyberarmEngine
|
|||||||
end
|
end
|
||||||
|
|
||||||
def position_on_next_line(element) # Flow
|
def position_on_next_line(element) # Flow
|
||||||
@current_position.x = 0
|
@current_position.x = styled(:margin_left) + styled(:padding_left)
|
||||||
@current_position.y += tallest_neighbor(element, @current_position.y).outer_height
|
@current_position.y += tallest_neighbor(element, @current_position.y).outer_height
|
||||||
|
|
||||||
element.x = @current_position.x
|
element.x = @current_position.x
|
||||||
|
|||||||
Reference in New Issue
Block a user