MCPcopy Create free account
hub / github.com/JacquesLucke/code_autocomplete / correct_index

Method correct_index

modal_handler.py:517–520  ·  view source on GitHub ↗
(self, amount)

Source from the content-addressed store, hash-verified

515 except: return None
516
517 def correct_index(self, amount):
518 self.selected_index = clamp(self.selected_index, 0, max(amount - 1, 0))
519 self.top_index = clamp(self.top_index, 0, max(amount - get_line_amount() - 1, 0))
520 self.top_index = clamp(self.top_index, self.selected_index - get_line_amount() + 1, self.selected_index)
521
522def get_line_amount():
523 preferences = get_addon_preferences()

Callers 2

drawMethod · 0.95
get_active_operatorMethod · 0.95

Calls 2

clampFunction · 0.85
get_line_amountFunction · 0.85

Tested by

no test coverage detected