From ded0936bc446735d97be6b8a0f8a827579337ef5 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 13 Feb 2025 19:02:39 +0400 Subject: [PATCH] Fix arbitrary aspect in photo editor crop. --- Telegram/SourceFiles/editor/photo_editor_layer_widget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/editor/photo_editor_layer_widget.cpp b/Telegram/SourceFiles/editor/photo_editor_layer_widget.cpp index 5143af395..257e47ec4 100644 --- a/Telegram/SourceFiles/editor/photo_editor_layer_widget.cpp +++ b/Telegram/SourceFiles/editor/photo_editor_layer_widget.cpp @@ -59,13 +59,14 @@ void OpenWithPreparedFile( }; auto copy = image->data; const auto fileImage = std::make_shared(std::move(copy)); + const auto keepRatio = !exactSize.isEmpty(); auto editor = base::make_unique_q( 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(parent, std::move(editor)); InitEditorLayer(layer.get(), raw, std::move(callback));