Browse Source

1,修改时间短时,时间条显示00 问题

jsonwang 3 năm trước cách đây
mục cha
commit
7d8921df7f

+ 2 - 1
BFFramework/Classes/Stuckpoint/View/PQStuckPointCuttingView.swift

@@ -217,7 +217,7 @@ class PQStuckPointCuttingView: UIView {
             titleLab.backgroundColor = .clear
             titleLab.textColor = UIColor.hexColor(hexadecimal: "#999999")
           
-            titleLab.text = "\(Float64(Int(index) * Int(timeRange)).formatDurationToHMS())"
+            titleLab.text = "\(Float64(Int(CGFloat(index) * timeRange)).formatDurationToHMS())"
             scrollView.addSubview(titleLab)
         }
         if oneMarginTime > 0 {
@@ -357,6 +357,7 @@ class PQStuckPointCuttingView: UIView {
         let lastLine:UIView = scrollView.viewWithTag(100 +  Int(videoDuration / timeRange) - 1) ?? UIView.init()
         //移动后的开始时间
         let startTime =  videoDuration / lastLine.frame.maxX * scrollView.contentOffset.x
+//        let startTime =  videoDuration * (margin + scrollView.contentOffset.x) / scrollView.contentSize.width
         //选中的时长
         let selectDuration:CGFloat = CGFloat(stuckPointEndTime - stuckPointStartTime)
         BFLog(message: "拖拽结束 - 回调\(scrollView.contentOffset)  \(scrollView.contentSize) 开始时间为:\(startTime) 结束时间为:\(startTime + selectDuration)")