mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2026-05-06 07:58:15 +00:00
Fixed ListBox/Menu not accounting for its border
This commit is contained in:
@@ -56,7 +56,7 @@ module CyberarmEngine
|
||||
def show_menu
|
||||
@menu.clear do
|
||||
|
||||
@menu.style.width = width
|
||||
@menu.style.width = width - (@menu.styled(:border_thickness_left) + @menu.styled(:border_thickness_right))
|
||||
|
||||
@items.each do |item|
|
||||
# prevent already selected item from appearing in list
|
||||
|
||||
@@ -11,10 +11,10 @@ module CyberarmEngine
|
||||
# FIXME: properly find scrollable parent, if any.
|
||||
parent_scroll_top = parent&.parent ? parent.parent.scroll_top : 0
|
||||
|
||||
@x = @parent.x
|
||||
@y = parent_scroll_top + @parent.y + @parent.height
|
||||
@x = @parent.x + @parent.styled(:border_thickness_left)
|
||||
@y = parent_scroll_top + @parent.y + @parent.height + @parent.styled(:border_thickness_top)
|
||||
|
||||
@y = (parent_scroll_top + @parent.y) - height if @y + height > window.height
|
||||
@y = (parent_scroll_top + @parent.y + @parent.styled(:border_thickness_top)) - height if @y + height > window.height
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
Reference in New Issue
Block a user