Skip to content

Commit

Permalink
add naehrstoff's fix for slider range ends
Browse files Browse the repository at this point in the history
Former-commit-id: 801a818
Former-commit-id: 51a14fe671ffc2d5f5e5457b06fdd60111ebe845
  • Loading branch information
jashkenas committed Dec 3, 2009
1 parent f03816e commit 5371a60
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions library/control_panel/control_panel.rb
Expand Up @@ -10,8 +10,7 @@ module ControlPanel
class Slider < javax.swing.JSlider
def initialize(control_panel, name, range, initial_value, proc=nil)
min = range.begin * 100
max = ((range.exclude_end? && range.begin.is_a?(Fixnum)) ? range.to_a.last : range.end) * 100
min, max = range.begin * 100, range.end * 100
max = ((range.exclude_end? && range.begin.respond_to?(:succ)) ? range.to_a.last : range.end) * 100
super(min, max)
set_minor_tick_spacing((max - min).abs / 10)
set_paint_ticks true
Expand Down

0 comments on commit 5371a60

Please sign in to comment.