Skip to content

Commit

Permalink
Merge pull request #2098 from MushroomObserver/mapset-sort-by-north
Browse files Browse the repository at this point in the history
Sort mapset boxes by `north` so they don't overlap
  • Loading branch information
nimmolo committed Apr 15, 2024
2 parents e698ddf + 60dc52d commit 4ee291f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/classes/mappable/collapsible_collection_of_objects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ def init_sets(objects)
raise("Tried to map #{obj.class} #{obj.id}.")
end
end
# Give the sets an initial sort by north value, before grouping.
# This gives orderly overlapping and means all boxes are clickable.
@sets = @sets.sort_by { |_key, value| value.north }.reverse.to_h
end

def group_objects_into_sets
Expand Down

0 comments on commit 4ee291f

Please sign in to comment.