feat(resize): expand aspect ratio presets in image adjust dialog
This commit is contained in:
parent
88f033f0c0
commit
795fcff90f
@ -266,14 +266,16 @@ export function ImageAnnotator({
|
|||||||
// 比例选项定义
|
// 比例选项定义
|
||||||
const aspectRatios = [
|
const aspectRatios = [
|
||||||
{ label: "智能", value: "smart", ratio: null }, // 智能:根据原图比例
|
{ 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: "1:1", value: "1:1", ratio: 1 / 1 },
|
||||||
{ label: "3:4", value: "3:4", ratio: 3 / 4 },
|
{ label: "16:9", value: "16:9", ratio: 16 / 9 },
|
||||||
{ label: "2:3", value: "2:3", ratio: 2 / 3 },
|
|
||||||
{ label: "9:16", value: "9:16", ratio: 9 / 16 },
|
{ 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 && (
|
{isResizeMode && (
|
||||||
<>
|
<>
|
||||||
<div className="flex items-center gap-2 px-2">
|
<div className="flex items-center gap-2 px-2">
|
||||||
{aspectRatios.slice(0, 4).map((ratio) => (
|
{aspectRatios.map((ratio) => (
|
||||||
<Button
|
<Button
|
||||||
key={ratio.value}
|
key={ratio.value}
|
||||||
variant={selectedAspectRatio === ratio.value ? "secondary" : "ghost"}
|
variant={selectedAspectRatio === ratio.value ? "secondary" : "ghost"}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user