From 60aa99af5343bca32a59778538a00e8a24a9f787 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Thu, 17 Aug 2023 13:00:25 -0700 Subject: [PATCH] chore: clean up measurement code in mini workspace bubble (#7408) --- core/bubbles/mini_workspace_bubble.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/core/bubbles/mini_workspace_bubble.ts b/core/bubbles/mini_workspace_bubble.ts index 035d7c661..963055081 100644 --- a/core/bubbles/mini_workspace_bubble.ts +++ b/core/bubbles/mini_workspace_bubble.ts @@ -218,12 +218,10 @@ export class MiniWorkspaceBubble extends Bubble { * Calculates the size of the mini workspace for use in resizing the bubble. */ private calculateWorkspaceSize(): Size { - // TODO (#7104): Clean this up to be more readable and unified for RTL - // vs LTR. - const canvas = this.miniWorkspace.getCanvas(); - const workspaceSize = canvas.getBBox(); - let width = workspaceSize.width + workspaceSize.x; + const workspaceSize = this.miniWorkspace.getCanvas().getBBox(); + let width = workspaceSize.width + MiniWorkspaceBubble.MARGIN; let height = workspaceSize.height + MiniWorkspaceBubble.MARGIN; + const flyout = this.miniWorkspace.getFlyout(); if (flyout) { const flyoutScrollMetrics = flyout @@ -233,10 +231,6 @@ export class MiniWorkspaceBubble extends Bubble { height = Math.max(height, flyoutScrollMetrics.height + 20); width += flyout.getWidth(); } - if (this.miniWorkspace.RTL) { - width = -workspaceSize.x; - } - width += MiniWorkspaceBubble.MARGIN; return new Size(width, height); }