Skip to content

Commit

Permalink
Fix missing hex_val conversions
Browse files Browse the repository at this point in the history
In the mosaic squares pattern, vals were being sent as strings from
the hash without being converted to numeric form first. When val > 9,
for examples, opacity incorrectly ends up at its minimum value 37.5%
of the time.
  • Loading branch information
btmills committed Feb 21, 2014
1 parent aa234be commit 2e5a6f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/geo_pattern/pattern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -678,15 +678,15 @@ def geo_mosaic_squares

if (x % 2 == 0)
if (y % 2 == 0)
draw_outer_mosaic_tile(x*triangle_size*2, y*triangle_size*2, triangle_size, hash[i])
draw_outer_mosaic_tile(x*triangle_size*2, y*triangle_size*2, triangle_size, hex_val(i, 1))
else
draw_inner_mosaic_tile(x*triangle_size*2, y*triangle_size*2, triangle_size, hash[i..i+1])
draw_inner_mosaic_tile(x*triangle_size*2, y*triangle_size*2, triangle_size, [hex_val(i, 1), hex_val(i+1, 1)])
end
else
if (y % 2 == 0)
draw_inner_mosaic_tile(x*triangle_size*2, y*triangle_size*2, triangle_size, hash[i..i+1])
draw_inner_mosaic_tile(x*triangle_size*2, y*triangle_size*2, triangle_size, [hex_val(i, 1), hex_val(i+1, 1)])
else
draw_outer_mosaic_tile(x*triangle_size*2, y*triangle_size*2, triangle_size, hash[i])
draw_outer_mosaic_tile(x*triangle_size*2, y*triangle_size*2, triangle_size, hex_val(i, 1))
end
end
i += 1
Expand Down

0 comments on commit 2e5a6f4

Please sign in to comment.