diff --git a/submodules/CheckNode/Sources/CheckNode.swift b/submodules/CheckNode/Sources/CheckNode.swift index f8aaab7cf0..86229c2222 100644 --- a/submodules/CheckNode/Sources/CheckNode.swift +++ b/submodules/CheckNode/Sources/CheckNode.swift @@ -478,7 +478,7 @@ public class CheckLayer: CALayer { case let .counter(number): let text = NSAttributedString(string: "\(number)", font: Font.with(size: 16.0, design: .round, weight: .regular, traits: []), textColor: parameters.theme.strokeColor.withMultipliedAlpha(parameters.animationProgress)) let textRect = text.boundingRect(with: CGSize(width: 100.0, height: 100.0), options: [.usesLineFragmentOrigin], context: nil) - text.draw(at: CGPoint(x: UIScreenPixel + textRect.minX + floor((size.width - textRect.width) * 0.5), y: textRect.minY + floor((size.height - textRect.height) * 0.5))) + text.draw(at: CGPoint(x: UIScreenPixel + textRect.minX + floor((size.width - textRect.width) * 0.5), y: textRect.minY + floorToScreenPixels((size.height - textRect.height) * 0.5))) } } } diff --git a/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift b/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift index 88c3d66f36..4bb1cadaf9 100644 --- a/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift +++ b/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift @@ -1452,13 +1452,13 @@ public final class MediaPickerScreen: ViewController, AttachmentContainable { } } - selectionState.setItem(item, selected: value) + let success = selectionState.setItem(item, selected: value) if showUndo { self.showSelectionUndo(item: item) } - return true + return success } else { return false } diff --git a/submodules/TranslateUI/Sources/ChatTranslation.swift b/submodules/TranslateUI/Sources/ChatTranslation.swift index 65c4c240bd..f87938649e 100644 --- a/submodules/TranslateUI/Sources/ChatTranslation.swift +++ b/submodules/TranslateUI/Sources/ChatTranslation.swift @@ -205,10 +205,7 @@ public func chatTranslationState(context: AccountContext, peerId: EnginePeer.Id) var fromLangs: [String: Int] = [:] var count = 0 for message in messages { - if let _ = URL(string: message.text) { - continue - } - if message.text.count >= 10 { + if message.effectivelyIncoming(context.account.peerId), message.text.count >= 10 { var text = String(message.text.prefix(256)) if var entities = message.textEntitiesAttribute?.entities.filter({ [.Pre, .Code, .Url, .Email, .Mention, .Hashtag, .BotCommand].contains($0.type) }) { entities = entities.sorted(by: { $0.range.lowerBound > $1.range.lowerBound })