feat(resize): expand aspect ratio presets in image adjust dialog
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-03-06 08:59:14 +08:00
parent 88f033f0c0
commit 795fcff90f

View File

@ -266,14 +266,16 @@ export function ImageAnnotator({
// 比例选项定义
const aspectRatios = [
{ label: "智能", value: "smart", ratio: null }, // 智能:根据原图比例
{ label: "21:9", value: "21:9", ratio: 21 / 9 },
{ label: "16:9", value: "16:9", ratio: 16 / 9 },
{ label: "3:2", value: "3:2", ratio: 3 / 2 },
{ label: "4:3", value: "4:3", ratio: 4 / 3 },
{ label: "1:1", value: "1:1", ratio: 1 / 1 },
{ label: "3:4", value: "3:4", ratio: 3 / 4 },
{ label: "2:3", value: "2:3", ratio: 2 / 3 },
{ label: "16:9", value: "16:9", ratio: 16 / 9 },
{ label: "9:16", value: "9:16", ratio: 9 / 16 },
{ label: "4:3", value: "4:3", ratio: 4 / 3 },
{ label: "3:4", value: "3:4", ratio: 3 / 4 },
{ label: "3:2", value: "3:2", ratio: 3 / 2 },
{ label: "2:3", value: "2:3", ratio: 2 / 3 },
{ label: "5:4", value: "5:4", ratio: 5 / 4 },
{ label: "4:5", value: "4:5", ratio: 4 / 5 },
{ label: "21:9", value: "21:9", ratio: 21 / 9 },
];
// 根据比例和宽度计算高度
@ -1684,7 +1686,7 @@ export function ImageAnnotator({
{isResizeMode && (
<>
<div className="flex items-center gap-2 px-2">
{aspectRatios.slice(0, 4).map((ratio) => (
{aspectRatios.map((ratio) => (
<Button
key={ratio.value}
variant={selectedAspectRatio === ratio.value ? "secondary" : "ghost"}