mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Ensure collaborator cursor colour is updated (#26847)
GitOrigin-RevId: 7057cdbb4815d5f1c5e5771d38255e58f592f9cd
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user