mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2026-09-19 21:33:51 +00:00
Compare commits
2 Commits
140e7a3619
...
b23e5c2a42
| Author | SHA1 | Date | |
|---|---|---|---|
| b23e5c2a42 | |||
| 747822aa61 |
@@ -203,9 +203,9 @@ module CyberarmEngine
|
||||
|
||||
case styled(:v_align)
|
||||
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
|
||||
@y = parent.y + parent.styled(:margin_top) + parent.height - height
|
||||
@y = parent.y + parent.outer_height - outer_height
|
||||
end
|
||||
end
|
||||
|
||||
@@ -214,9 +214,9 @@ module CyberarmEngine
|
||||
|
||||
case styled(:h_align)
|
||||
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
|
||||
@x = parent.x + parent.styled(:margin_left) + parent.width - width
|
||||
@x = parent.x + parent.outer_width - outer_width
|
||||
end
|
||||
end
|
||||
|
||||
@@ -285,7 +285,7 @@ module CyberarmEngine
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
element.x = @current_position.x
|
||||
|
||||
@@ -98,7 +98,15 @@ module CyberarmEngine
|
||||
Stats.frame.start_timing(:gui_element_recalculate_requests)
|
||||
|
||||
# puts "PENDING REQUESTS: #{@pending_element_recalculate_requests.size}" if @pending_element_recalculate_requests.size.positive?
|
||||
@pending_element_recalculate_requests.shift(&:recalculate)
|
||||
while (e = @pending_element_recalculate_requests.shift)
|
||||
# its pointless to recalculate individual elements when we've been asked to recalculate the whole gui
|
||||
if @pending_recalculate_request
|
||||
@pending_element_recalculate_requests.clear
|
||||
break
|
||||
end
|
||||
|
||||
e.recalculate
|
||||
end
|
||||
|
||||
Stats.frame.end_timing(:gui_element_recalculate_requests)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user