mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-07 17:30:12 +00:00
Various fixes
This commit is contained in:
parent
0908a3cf63
commit
a375a49dfd
@ -478,7 +478,7 @@ public class CheckLayer: CALayer {
|
|||||||
case let .counter(number):
|
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 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)
|
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)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1452,13 +1452,13 @@ public final class MediaPickerScreen: ViewController, AttachmentContainable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
selectionState.setItem(item, selected: value)
|
let success = selectionState.setItem(item, selected: value)
|
||||||
|
|
||||||
if showUndo {
|
if showUndo {
|
||||||
self.showSelectionUndo(item: item)
|
self.showSelectionUndo(item: item)
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return success
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -205,10 +205,7 @@ public func chatTranslationState(context: AccountContext, peerId: EnginePeer.Id)
|
|||||||
var fromLangs: [String: Int] = [:]
|
var fromLangs: [String: Int] = [:]
|
||||||
var count = 0
|
var count = 0
|
||||||
for message in messages {
|
for message in messages {
|
||||||
if let _ = URL(string: message.text) {
|
if message.effectivelyIncoming(context.account.peerId), message.text.count >= 10 {
|
||||||
continue
|
|
||||||
}
|
|
||||||
if message.text.count >= 10 {
|
|
||||||
var text = String(message.text.prefix(256))
|
var text = String(message.text.prefix(256))
|
||||||
if var entities = message.textEntitiesAttribute?.entities.filter({ [.Pre, .Code, .Url, .Email, .Mention, .Hashtag, .BotCommand].contains($0.type) }) {
|
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 })
|
entities = entities.sorted(by: { $0.range.lowerBound > $1.range.lowerBound })
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user