lib/cyberarm_engine/ui/elements/slider.rb in cyberarm_engine-0.21.0 vs lib/cyberarm_engine/ui/elements/slider.rb in cyberarm_engine-0.22.0
- old
+ new
@@ -40,11 +40,11 @@
@range = @options[:range] || (0.0..1.0)
@step_size = @options[:step] || 0.1
@value = @options[:value] || (@range.first + @range.last) / 2
- @handle = Handle.new("", parent: self, width: 8, height: 1.0) { close }
+ @handle = Handle.new("", parent: self, theme: options[:theme], width: 8, height: 1.0) { close }
add(@handle)
end
def recalculate
_width = dimensional_size(@style.width, :width)
@@ -59,13 +59,13 @@
update_background
end
def position_handle
- @handle.x = @x + @style.padding_left + @style.border_thickness_left +
+ @handle.x = @x + @handle.style.margin_left + @style.padding_left + @style.border_thickness_left +
((content_width - @handle.outer_width) * (@value - @range.min) / (@range.max - @range.min).to_f)
- @handle.y = @y + @style.border_thickness_top + @style.padding_top
+ @handle.y = @y + @handle.style.margin_top + @style.border_thickness_top + @style.padding_top
end
def draw
super