diff --git a/app/helpers/splats_helper.rb b/app/helpers/splats_helper.rb index 6a3f860c8..607f51b02 100644 --- a/app/helpers/splats_helper.rb +++ b/app/helpers/splats_helper.rb @@ -1,12 +1,13 @@ module SplatsHelper SPLAT_ROTATION = %w[90 80 75 60 45 35 25 5 -45 -40 -75] - SPLAT_SIZE = %w[22 18 16 14] + SPLAT_SIZE = [14, 16, 18, 20, 22] + MIN_THRESHOLD = 7 def splat_rotation(splat) "--splat-rotate: #{ SPLAT_ROTATION[Zlib.crc32(splat.to_param) % SPLAT_ROTATION.size] }deg;" end def splat_size(splat) - "--splat-size: #{ SPLAT_SIZE[Zlib.crc32(splat.to_param) % SPLAT_SIZE.size] }cqi;" + "--splat-size: #{ SPLAT_SIZE.min_by { |size| (size - (splat.boosts.size + splat.comments.size + MIN_THRESHOLD)).abs } }cqi;" end end