2
0
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:
23rd
2021-02-08 10:01:15 +03:00
parent 85c21ba0e4
commit e1ea833ad6
8 changed files with 438 additions and 8 deletions

View File

@@ -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