mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Added ability to crop images in photo editor.
This commit is contained in:
@@ -20,7 +20,11 @@ QImage ImageModified(QImage image, const PhotoModifications &mods) {
|
||||
if (mods.angle) {
|
||||
transform.rotate(mods.angle);
|
||||
}
|
||||
return image.transformed(transform);
|
||||
auto newImage = image.transformed(transform);
|
||||
if (mods.crop.isValid()) {
|
||||
newImage = newImage.copy(mods.crop);
|
||||
}
|
||||
return newImage;
|
||||
}
|
||||
|
||||
} // namespace Editor
|
||||
|
Reference in New Issue
Block a user