Rename color_index to participant_index

Co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
Max Brunsfeld
2023-09-28 11:37:22 -07:00
co-authored by Conrad
parent 545b5e0161
commit 0f39b63801
17 changed files with 97 additions and 80 deletions
+2 -5
View File
@@ -1064,15 +1064,12 @@ impl<'de, T: DeserializeOwned> Deserialize<'de> for Interactive<T> {
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct ColorIndex(pub u32);
impl Editor {
pub fn replica_selection_style(&self, color_index: ColorIndex) -> SelectionStyle {
pub fn selection_style_for_room_participant(&self, participant_index: u32) -> SelectionStyle {
if self.guest_selections.is_empty() {
return SelectionStyle::default();
}
let style_ix = color_index.0 as usize % self.guest_selections.len();
let style_ix = participant_index as usize % self.guest_selections.len();
self.guest_selections[style_ix]
}
}