mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-16 05:02:34 +00:00
Call recalulate less often to speed up gui updates, call root_container.recalculate a third time when recalculating gui. Gui calls recalculate 10x less when doing a full recalculate.
This commit is contained in:
@@ -128,8 +128,6 @@ module CyberarmEngine
|
||||
element.x = element.style.margin_left + @current_position.x
|
||||
element.y = element.style.margin_top + @current_position.y
|
||||
|
||||
element.recalculate
|
||||
|
||||
@current_position.x += element.outer_width
|
||||
@current_position.x = @style.margin_left if @current_position.x >= max_width
|
||||
end
|
||||
@@ -151,8 +149,6 @@ module CyberarmEngine
|
||||
child.x = child.style.margin_left + @current_position.x
|
||||
child.y = child.style.margin_top + @current_position.y
|
||||
|
||||
child.recalculate
|
||||
|
||||
@current_position.x += child.outer_width
|
||||
end
|
||||
|
||||
@@ -160,8 +156,6 @@ module CyberarmEngine
|
||||
element.x = element.style.margin_left + @current_position.x
|
||||
element.y = element.style.margin_top + @current_position.y
|
||||
|
||||
element.recalculate
|
||||
|
||||
@current_position.y += element.outer_height
|
||||
end
|
||||
|
||||
|
||||
@@ -53,6 +53,8 @@ module CyberarmEngine
|
||||
if @pending_recalculate_request
|
||||
@root_container.recalculate
|
||||
@root_container.recalculate
|
||||
@root_container.recalculate
|
||||
|
||||
@pending_recalculate_request = false
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user