Skip to content

Commit da02332

Browse files
committed
fix data_path
1 parent 86cce1a commit da02332

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

external_library/gem/toxiclibs/simulation/gray_scott_image.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
def setup
4040
sketch_title 'Gray Scott Image'
4141
@gs = Simulation::GrayScott.new width, height, true
42-
@img = load_image 'ti_yong.png'
42+
@img = load_image(data_path('ti_yong.png'))
4343
# create a duo-tone gradient map with 256 steps
4444
# NB: use '::' in place of '.' here for these java constants
4545
@tone_map = Toxi::ToneMap.new(0, 0.33, Toxi::NamedColor::CRIMSON, Toxi::NamedColor::WHITE, 256)
@@ -62,9 +62,9 @@ def key_pressed
6262
control_key = %w[1 2 3 4 5 6 7 8 9].freeze
6363
case key
6464
when *control_key
65-
@gs.setF(0.02 + (key.ord - 48) * 0.001)
65+
@gs.setF(0.02 + (key.to_i) * 0.001)
6666
when 's'
67-
save_frame 'toxi.png'
67+
save_frame(data_path('toxi.png'))
6868
else
6969
@gs.reset()
7070
end

0 commit comments

Comments
 (0)