Skip to content

Commit

Permalink
- bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
overtake committed Jul 1, 2024
1 parent c173abe commit 90d6dfc
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Telegram-Mac/ChatSendAsMenuItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private final class ContextSendAsMenuRowItem : AppMenuRowItem {

let peer = self.peer.peer

signal = peerAvatarImage(account: context.account, photo: .peer(peer, peer.smallProfileImage, peer.nameColor, peer.displayLetters, nil), displayDimensions: NSMakeSize(25 * System.backingScale, 25 * System.backingScale), font: .avatar(20), genCap: true, synchronousLoad: false, disableForum: true) |> deliverOnMainQueue
signal = peerAvatarImage(account: context.account, photo: .peer(peer, peer.smallProfileImage, peer.nameColor, peer.displayLetters, nil), displayDimensions: NSMakeSize(25 * System.backingScale, 25 * System.backingScale), font: .avatar(14), genCap: true, synchronousLoad: false, disableForum: true) |> deliverOnMainQueue
disposable.set(signal.start(next: { [weak item] image, _ in
if let image = image {
item?.image = NSImage(cgImage: image, size: NSMakeSize(25, 25))
Expand Down
2 changes: 1 addition & 1 deletion Telegram-Mac/ChatServiceItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2453,7 +2453,7 @@ class ChatServiceRowView: TableRowView {
} else if case let .avatar(peer) = stickerItem.source {
let id = InlineStickerItemLayer.Key(id: peer.id.toInt64(), index: index)
validIds.append(id)
var rect = NSMakeRect(item.rect.minX, item.rect.minY, item.rect.width - 3, item.rect.width - 3)
var rect = NSMakeRect(item.rect.minX, item.rect.minY + 1, item.rect.width - 3, item.rect.width - 3)

if textView.textLayout?.hasBlock == true {
rect.origin.x += 7
Expand Down
2 changes: 1 addition & 1 deletion Telegram-Mac/FoldingTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ private final class WrapperView : View {
} else if case let .avatar(peer) = stickerItem.source {
let id = InlineStickerItemLayer.Key(id: peer.id.toInt64(), index: index)
validIds.append(id)
let rect = NSMakeRect(item.rect.minX, item.rect.minY + 2, item.rect.width, item.rect.width)
let rect = NSMakeRect(item.rect.minX, item.rect.minY + 2, item.rect.width - 3, item.rect.width - 3)

let view: InlineAvatarLayer
if let current = itemViews[id] as? InlineAvatarLayer {
Expand Down
2 changes: 1 addition & 1 deletion Telegram-Mac/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>265360</string>
<string>265379</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationCategoryType</key>
Expand Down
1 change: 1 addition & 0 deletions Telegram-Mac/InlineStickerItemLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ final class InlineStickerItemLayer : SimpleLayer {
if file.mimeType == "bundle/jpeg", let resource = file.resource as? LocalBundleResource {
let image = NSImage(named: resource.name)?.precomposed(resource.color ?? theme.colors.accentIcon, scale: System.backingScale)
self.contents = image

if resource.resize {
self.contentsGravity = .resizeAspect
} else {
Expand Down
2 changes: 1 addition & 1 deletion TelegramShare/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>265360</string>
<string>265379</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSMinimumSystemVersion</key>
Expand Down
8 changes: 5 additions & 3 deletions packages/TGUIKit/Sources/TextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1021,13 +1021,15 @@ public final class TextViewLayout : Equatable {
}

if abs(rightOffset - leftOffset) < 150, abs(rightOffset - leftOffset) > 8 {
let x = floor(min(leftOffset, rightOffset))
let x = floor(min(leftOffset, rightOffset)) - 1
var width = floor(abs(rightOffset - leftOffset) + rightInset)
if Int(width) % 2 != 0 {
width -= 1
width += 1
}
let height = ceil(ascent + descent)
embeddedItems.append(TextViewEmbeddedItem(range: NSMakeRange(startIndex, endIndex - startIndex), frame: CGRect(x: x, y: floor(descent - (ascent + descent)), width: width, height: height), item: item))
let size = NSMakeSize(width, height)
let rect = CGRect(x: x, y: floor(descent - (ascent + descent)), width: size.width, height: size.height)
embeddedItems.append(TextViewEmbeddedItem(range: NSMakeRange(startIndex, endIndex - startIndex), frame: rect.insetBy(dx: -2, dy: -2), item: item))
}
}

Expand Down

0 comments on commit 90d6dfc

Please sign in to comment.