Fixed debug_draw for elements, fixed Slider Handle not rendering/positioned properly

This commit is contained in:
2024-03-05 13:17:12 -06:00
parent c2330ed9a9
commit dcefaeae4d
3 changed files with 6 additions and 8 deletions

View File

@@ -331,8 +331,7 @@ module CyberarmEngine
end end
def debug_draw def debug_draw
# FIXME return if CyberarmEngine.const_defined?("GUI_DEBUG_ONLY_ELEMENT") && self.class == GUI_DEBUG_ONLY_ELEMENT
return# if const_defined?(GUI_DEBUG_ONLY_ELEMENT) && self.class == GUI_DEBUG_ONLY_ELEMENT
Gosu.draw_line( Gosu.draw_line(
x, y, @debug_color, x, y, @debug_color,
@@ -350,7 +349,7 @@ module CyberarmEngine
Float::INFINITY Float::INFINITY
) )
Gosu.draw_line( Gosu.draw_line(
x, outer_height, @debug_color, x, y + outer_height, @debug_color,
x, y, @debug_color, x, y, @debug_color,
Float::INFINITY Float::INFINITY
) )

View File

@@ -33,7 +33,7 @@ module CyberarmEngine
end end
end end
attr_reader :step_size, :value attr_reader :value
attr_accessor :range, :step_size attr_accessor :range, :step_size
def initialize(options = {}, block = nil) def initialize(options = {}, block = nil)
@@ -47,7 +47,7 @@ module CyberarmEngine
add(@handle) add(@handle)
end end
def layout def recalculate
_width = dimensional_size(@style.width, :width) _width = dimensional_size(@style.width, :width)
_height = dimensional_size(@style.height, :height) _height = dimensional_size(@style.height, :height)
@@ -55,7 +55,7 @@ module CyberarmEngine
@height = _height @height = _height
position_handle position_handle
@handle.layout @handle.recalculate
@handle.update_background @handle.update_background
update_background update_background

View File

@@ -85,8 +85,7 @@ module CyberarmEngine
@tip.draw @tip.draw
end end
# FIXME if CyberarmEngine.const_defined?("GUI_DEBUG")
if false# defined?(GUI_DEBUG)
Gosu.flush Gosu.flush
@root_container.debug_draw @root_container.debug_draw