diff --git a/core/comments/comment_view.ts b/core/comments/comment_view.ts index 4cb144b46..553f7d02b 100644 --- a/core/comments/comment_view.ts +++ b/core/comments/comment_view.ts @@ -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}`);