mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-05-08 11:00:11 +08:00
fixe code scrolling
This commit is contained in:
@@ -69,7 +69,7 @@ final class IssueCommentCodeBlockCell: UICollectionViewCell, ListBindable, Colla
|
||||
func bindViewModel(_ viewModel: Any) {
|
||||
guard let viewModel = viewModel as? IssueCommentCodeBlockModel else { return }
|
||||
|
||||
let contentSize = viewModel.code.textViewSize(contentView.bounds.width)
|
||||
let contentSize = viewModel.contentSize
|
||||
scrollView.contentSize = contentSize
|
||||
|
||||
label.attributedText = viewModel.code.attributedText
|
||||
|
||||
@@ -22,6 +22,12 @@ final class IssueCommentCodeBlockModel: NSObject, ListDiffable {
|
||||
self.language = language
|
||||
}
|
||||
|
||||
// MARK: Public API
|
||||
|
||||
var contentSize: CGSize {
|
||||
return code.textViewSize(0)
|
||||
}
|
||||
|
||||
// MARK: ListDiffable
|
||||
|
||||
func diffIdentifier() -> NSObjectProtocol {
|
||||
|
||||
@@ -13,7 +13,7 @@ func bodyHeight(viewModel: Any, width: CGFloat) -> CGFloat {
|
||||
return viewModel.textViewSize(width).height
|
||||
} else if let viewModel = viewModel as? IssueCommentCodeBlockModel {
|
||||
let inset = IssueCommentCodeBlockCell.scrollViewInset
|
||||
return viewModel.code.textViewSize(0).height + inset.top + inset.bottom
|
||||
return viewModel.contentSize.height + inset.top + inset.bottom
|
||||
} else if viewModel is IssueCommentImageModel {
|
||||
return 200.0
|
||||
} else if viewModel is IssueCommentReactionViewModel {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>88</string>
|
||||
<string>89</string>
|
||||
<key>LSApplicationQueriesSchemes</key>
|
||||
<array>
|
||||
<string>org-appextension-feature-password-management</string>
|
||||
|
||||
Reference in New Issue
Block a user