mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Various improvements
This commit is contained in:
@@ -133,13 +133,13 @@ public final class DrawingTextEntityView: DrawingEntityView, UITextViewDelegate
|
||||
return false
|
||||
}
|
||||
|
||||
if isPNG && images.count == 1, let image = images.first, let cgImage = image.cgImage {
|
||||
if isPNG && images.count == 1, let image = images.first {
|
||||
let maxSide = max(image.size.width, image.size.height)
|
||||
if maxSide.isZero {
|
||||
return false
|
||||
}
|
||||
let aspectRatio = min(image.size.width, image.size.height) / maxSide
|
||||
if isMemoji || (imageHasTransparency(cgImage) && aspectRatio > 0.2) {
|
||||
if isMemoji || (imageHasTransparency(image) && aspectRatio > 0.2) {
|
||||
self.endEditing(reset: true)
|
||||
self.replaceWithImage(image, true)
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user