From 34273f4ef7ab2c049ba89b33fc1de5fe2d05486d Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Tue, 20 Aug 2024 10:55:54 -0500 Subject: [PATCH] Try a simple calculation to size bubbles by number activity --- app/helpers/splats_helper.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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