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
def debug_draw
# FIXME
return# if const_defined?(GUI_DEBUG_ONLY_ELEMENT) && self.class == GUI_DEBUG_ONLY_ELEMENT
return if CyberarmEngine.const_defined?("GUI_DEBUG_ONLY_ELEMENT") && self.class == GUI_DEBUG_ONLY_ELEMENT
Gosu.draw_line(
x, y, @debug_color,
@@ -350,7 +349,7 @@ module CyberarmEngine
Float::INFINITY
)
Gosu.draw_line(
x, outer_height, @debug_color,
x, y + outer_height, @debug_color,
x, y, @debug_color,
Float::INFINITY
)

View File

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

View File

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