mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-29 13:39:06 +00:00
Fix arbitrary aspect in photo editor crop.
This commit is contained in:
parent
16830a410c
commit
ded0936bc4
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user