File tree Expand file tree Collapse file tree 3 files changed +16
-17
lines changed
Expand file tree Collapse file tree 3 files changed +16
-17
lines changed Original file line number Diff line number Diff line change 1919 <key >CFBundleShortVersionString </key >
2020 <string >Explosion v1.0.0-alpha </string >
2121 <key >CFBundleVersion </key >
22- <string >103046 </string >
22+ <string >103067 </string >
2323 <key >LSApplicationCategoryType </key >
2424 <string >public.app-category.utilities </string >
2525 <key >LSMinimumSystemVersion </key >
Original file line number Diff line number Diff line change @@ -31,13 +31,9 @@ extension PasteItem {
3131 if pType == . string {
3232 return NSAttributedString ( string: String ( data: data, encoding: . utf8) ?? " [error data] " )
3333 }
34- if pType == . html {
35- // html使用nsattributedstring有渲染性能问题,先特殊处理
36- let str = NSAttributedString ( html: data, documentAttributes: nil )
37- return NSAttributedString ( string: str? . string ?? " [empty html data] " )
38- }
34+ // NSAttributedString 会有性能问题,导致应用卡死
3935 if let str = NSAttributedString ( pasteboardPropertyList: data, ofType: pType) {
40- return str
36+ return NSAttributedString ( string : str. string )
4137 }
4238 if let url = URL ( dataRepresentation: data, relativeTo: nil ) {
4339 return NSAttributedString ( string: url. absoluteString)
Original file line number Diff line number Diff line change @@ -164,16 +164,19 @@ class MainView: NSVisualEffectView {
164164 }
165165
166166 @objc private func scrollViewBoundsHandler( _ notification: Notification ) {
167- guard let documentView = scrollView. documentView else { return }
168-
169- let clipView = scrollView . contentView
170- let bottomDistance = documentView . bounds . height - ( clipView . bounds. origin . y + clipView . bounds . height )
171- if bottomDistance == 0 {
172- let notification = Notification (
173- name : MainView . reachBottomNotification ,
174- object : nil )
175- NotificationCenter . default . post ( notification )
167+ guard let documentBounds = scrollView. documentView? . frame else { return }
168+ let insets = scrollView . contentView . contentInsets
169+
170+ let clipBounds = scrollView . contentView . bounds
171+
172+ let bottomDistance = Config . shared . scrollDirection == . vertical
173+ ? documentBounds . height - ( clipBounds . origin . y + clipBounds . height ) + insets . bottom
174+ : documentBounds . width - ( clipBounds . origin . x + clipBounds . width ) + insets . right
175+ if bottomDistance != 0 { return }
176176
177- }
177+ let notification = Notification (
178+ name: MainView . reachBottomNotification,
179+ object: nil )
180+ NotificationCenter . default. post ( notification)
178181 }
179182}
You can’t perform that action at this time.
0 commit comments