Containers that need to be recalculated but will not affect their current size can request to have themselves directly recalculated on the next update (fixes scrolling triggering many unneed recalculations), list_box now excludes the currently selected item from the menu, probably fixed list_box callback being called twice instead of the correct once.

This commit is contained in:
2021-11-15 10:17:49 -06:00
parent d2bf406d29
commit 0aa9b59316
3 changed files with 21 additions and 3 deletions

View File

@@ -194,7 +194,9 @@ module CyberarmEngine
if @scroll_position.y < 0
@scroll_position.y += @scroll_speed
@scroll_position.y = 0 if @scroll_position.y > 0
recalculate
# recalculate
root.gui_state.request_recalculate_for(self)
return :handled
end
@@ -208,7 +210,9 @@ module CyberarmEngine
if @scroll_position.y.abs < max_scroll_height
@scroll_position.y -= @scroll_speed
@scroll_position.y = -max_scroll_height if @scroll_position.y.abs > max_scroll_height
recalculate
# recalculate
root.gui_state.request_recalculate_for(self)
return :handled
end