KMScroller.swift 457 B

1234567891011121314151617181920212223242526
  1. //
  2. // KMScroller.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by liujiajie on 2024/1/18.
  6. //
  7. import Cocoa
  8. class KMScroller: NSScroller{
  9. var isScrolling = false
  10. override class var isCompatibleWithOverlayScrollers: Bool{
  11. return true
  12. }
  13. override func trackKnob(with event: NSEvent) {
  14. isScrolling = true
  15. super.trackKnob(with: event)
  16. isScrolling = false
  17. superview?.needsDisplay = true
  18. }
  19. }