From 23af202796547f94966402fba4cee64da90abe94 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Thu, 16 May 2024 10:36:36 -0700 Subject: [PATCH] fix: workspace comment bounding box affecting RTL zoom (#8125) --- core/comments/rendered_workspace_comment.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/comments/rendered_workspace_comment.ts b/core/comments/rendered_workspace_comment.ts index a2b4d689f..b37c125e1 100644 --- a/core/comments/rendered_workspace_comment.ts +++ b/core/comments/rendered_workspace_comment.ts @@ -124,7 +124,16 @@ export class RenderedWorkspaceComment getBoundingRectangle(): Rect { const loc = this.getRelativeToSurfaceXY(); const size = this.getSize(); - return new Rect(loc.y, loc.y + size.height, loc.x, loc.x + size.width); + let left; + let right; + if (this.workspace.RTL) { + left = loc.x - size.width; + right = loc.x; + } else { + left = loc.x; + right = loc.x + size.width; + } + return new Rect(loc.y, loc.y + size.height, left, right); } /** Move the comment by the given amounts in workspace coordinates. */