code: def selected_objects(self, pos):
          '''return a list of matching objects for a position'''
          state = self.state
          selected = []
          (px, py) = pos
          for layer in state.layers:
              for key in state.layers[layer]:
                  obj = state.layers[layer][key]
                  distance = obj.clicked(px, py)
                  if distance is not None:
                      selected.append(SlipObjectSelection(key, distance, layer, extra_info=obj.selection_info()))
          selected.sort(key=lambda c: c.distance)
          return selectef selected_objects(self, pos):
          '''return a list of matching objects for a position'''
          state = self.state
          selected = []
          (px, py) = pos
          for layer in state.layers:
              for key in state.layers[layer]:
                  obj = state.layers[layer][key]
                  distance = obj.clicked(px, py)
                  if distance is not None:
                      selected.append(SlipObjectSelection(key, distance, layer, extra_info=obj.selection_info()))
          selected.sort(key=lambda c: c.distance)
          return selected
docs: return a list of matching objects for a position