refactor: split reader architecture and chrome handling

This commit is contained in:
shen
2026-05-31 21:47:54 +08:00
parent ea21c6a831
commit 44202357c0
80 changed files with 10635 additions and 8522 deletions
@@ -0,0 +1,27 @@
import CoreGraphics
struct RDReaderTapRegionHandler {
func resolveTapEvent(
point: CGPoint,
viewFrame: CGRect,
isToolViewVisible: Bool
) -> RDReaderView.TapEvent {
let leftFrame = CGRect(x: 0, y: 0, width: viewFrame.width / 3, height: viewFrame.height)
let centerFrame = CGRect(x: viewFrame.width / 3, y: 0, width: viewFrame.width / 3, height: viewFrame.height)
let rightFrame = CGRect(x: viewFrame.width * 2 / 3, y: 0, width: viewFrame.width / 3, height: viewFrame.height)
if leftFrame.contains(point) {
return isToolViewVisible ? .center : .left
}
if centerFrame.contains(point) {
return .center
}
if rightFrame.contains(point) {
return isToolViewVisible ? .center : .right
}
return .none
}
}