Ensure collaborator cursor colour is updated (#26847)

GitOrigin-RevId: 7057cdbb4815d5f1c5e5771d38255e58f592f9cd
This commit is contained in:
Alf Eaton
2025-07-10 08:07:23 +00:00
committed by Copybot
parent bd64f09b91
commit 3e9d60c25a
@@ -166,7 +166,7 @@ export const setCursorHighlights = (
class CursorMarker extends RectangleMarker {
constructor(
private highlight: Highlight,
public highlight: Highlight,
className: string,
left: number,
top: number,
@@ -181,6 +181,18 @@ class CursorMarker extends RectangleMarker {
element.style.setProperty('--hue', String(this.highlight.hue))
return element
}
update(element: HTMLDivElement, prev: CursorMarker) {
if (!super.update(element, prev)) {
return false
}
element.style.setProperty('--hue', String(this.highlight.hue))
return true
}
eq(other: CursorMarker) {
return super.eq(other) && this.highlight.hue === other.highlight.hue
}
}
// draw the collaborator cursors in a separate layer, so they don't affect word wrapping