fix: comment highlight being positioned incorrectly in RTL (#8044)

This commit is contained in:
Beka Westberg
2024-04-19 18:33:25 +00:00
committed by GitHub
parent 69c5557e4f
commit 93c4d75fbd

View File

@@ -311,9 +311,8 @@ export class CommentView implements IRenderedElement {
this.svgRoot.setAttribute('height', `${size.height}`);
this.svgRoot.setAttribute('width', `${size.width}`);
this.highlightRect.setAttribute('height', `${size.height}`);
this.highlightRect.setAttribute('width', `${size.width}`);
this.updateHighlightRect(size);
this.updateTopBarSize(size);
this.updateTextAreaSize(size, topBarSize);
this.updateDeleteIconPosition(size, topBarSize, deleteSize);
@@ -377,6 +376,15 @@ export class CommentView implements IRenderedElement {
return (topBarSize.height - foldoutSize.height) / 2;
}
/** Updates the size of the highlight rect to reflect the new size. */
private updateHighlightRect(size: Size) {
this.highlightRect.setAttribute('height', `${size.height}`);
this.highlightRect.setAttribute('width', `${size.width}`);
if (this.workspace.RTL) {
this.highlightRect.setAttribute('x', `${-size.width}`);
}
}
/** Updates the size of the top bar to reflect the new size. */
private updateTopBarSize(size: Size) {
this.topBarBackground.setAttribute('width', `${size.width}`);