Skip to content

Commit a2bfe39

Browse files
committed
Update draw collab docstring
1 parent 77832b0 commit a2bfe39

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/frontend.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,8 @@ void redraw_canvas_win() {
365365
}
366366

367367
/* Draw all visible collaborator cursors on the canvas.
368+
*
369+
* Collaborator cursor colors are from `cursors_colors` and set by uid.
368370
*/
369371
void draw_collab_cursors(collab_list_t *collab_list) {
370372
collab_t *c = NULL;
@@ -374,6 +376,7 @@ void draw_collab_cursors(collab_list_t *collab_list) {
374376
const int max_y = min(view_max_y, view->canvas->num_rows - view->y);
375377
for (int i = 0; i < collab_list->len; i++) {
376378
c = collab_list->list[i];
379+
// only draw cursors that exist and are visible on the screen
377380
if (c != NULL && (c->x >= min_x && c->y <= max_x) &&
378381
(c->y >= min_y && c->y <= max_y)) {
379382
logd("Drawing collab %i\n", c->uid);

0 commit comments

Comments
 (0)