Skip to content

Commit 83959b2

Browse files
committed
fix(frontend): stop zoom menubar from resizing on zoom change
The canvas zoom control had no left padding (the percentage nearly touched the edge) and its width tracked the label length, so the menubar expanded and contracted as the zoom value changed (e.g. '200%' is wider than '96%'). Give the zoom label a fixed width sized for the widest value ('200%' at MAX_ZOOM=2), left padding, and tabular-nums so digit widths stay constant. The chevron and adjacent controls now hold position across the full 25%-200% zoom range.
1 parent 15bf10d commit 83959b2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/frontend/src/components/core/canvasControlsComponent/CanvasControlsDropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const CanvasControlsDropdown = ({
107107
title={t("canvas.controls")}
108108
>
109109
<div className="flex items-center justify-center gap-1">
110-
<span className="text-sm text-muted-foreground group-hover:text-foreground">
110+
<span className="w-11 pl-1.5 text-left text-sm tabular-nums text-muted-foreground group-hover:text-foreground">
111111
{formatZoomPercentage(zoom)}
112112
</span>
113113
<IconComponent

0 commit comments

Comments
 (0)