Fix arbitrary aspect in photo editor crop.

This commit is contained in:
John Preston 2025-02-13 19:02:39 +04:00
parent 16830a410c
commit ded0936bc4

View file

@ -59,13 +59,14 @@ void OpenWithPreparedFile(
};
auto copy = image->data;
const auto fileImage = std::make_shared<Image>(std::move(copy));
const auto keepRatio = !exactSize.isEmpty();
auto editor = base::make_unique_q<PhotoEditor>(
parent,
show,
show,
fileImage,
image->modifications,
EditorData{ .exactSize = exactSize, .keepAspectRatio = true });
EditorData{ .exactSize = exactSize, .keepAspectRatio = keepRatio });
const auto raw = editor.get();
auto layer = std::make_unique<LayerWidget>(parent, std::move(editor));
InitEditorLayer(layer.get(), raw, std::move(callback));