瀏覽代碼

1,修改进度更新方法 2, 初始化时不初始化数据

jsonwang 3 年之前
父節點
當前提交
a216737543
共有 1 個文件被更改,包括 10 次插入17 次删除
  1. 10 17
      BFFramework/Classes/Stuckpoint/View/PQStuckPointCuttingView.swift

+ 10 - 17
BFFramework/Classes/Stuckpoint/View/PQStuckPointCuttingView.swift

@@ -157,9 +157,7 @@ class PQStuckPointCuttingView: UIView {
         if videoDuration < maxCutTime {
             maxCutTime = videoDuration
         }
-
-        // 更新卡点值
-        updateEndTime(startTime: startTime, endTime: endTime)
+ 
     }
 
     /// 更新卡点值
@@ -261,20 +259,15 @@ class PQStuckPointCuttingView: UIView {
     /// 更新进度绘制不同色值
     /// progress <#progress description#>
     func updateProgress(progress: CGFloat) {
-        
-//        let seartIndex = stuckPointStartTime / oneMarginTime
-//        for (i, layer) in lineLayerArray.enumerated() {
-//
-////            if CGFloat(i) * oneMarginTime <= stuckPointStartTime + progress * CGFloat(stuckPointEndTime - stuckPointStartTime) && CGFloat(i) * oneMarginTime >= stuckPointStartTime {
-//            if(i > Int(seartIndex) && i < Int(seartIndex) + wavSelectCount){
-//
-//                BFLog(message: "progress is \(progress) i \(i) 命中的位置:\(CGFloat(i) * oneMarginTime)")
-//                layer.strokeColor = UIColor.hexColor(hexadecimal: PQBFConfig.shared.styleColor.rawValue).cgColor
-//                layer.setNeedsDisplay()
-//                usleep(UInt32(CGFloat(stuckPointEndTime - stuckPointStartTime) / CGFloat(wavSelectCount) * 1000))
-//
-//            }
-//        }
+
+        let startIndex = stuckPointStartTime / oneMarginTime
+        BFLog(message: "startIndex is\(startIndex) stuckPointStartTime is: \(stuckPointStartTime)")
+        let selectIndex = Int(startIndex + progress * CGFloat(wavSelectCount))
+        let drawLayer:CAShapeLayer = lineLayerArray[selectIndex]
+        BFLog(message: "progress is \(progress) i \(selectIndex) 命中的位置:\(CGFloat(selectIndex) * oneMarginTime)")
+        drawLayer.strokeColor = UIColor.hexColor(hexadecimal: PQBFConfig.shared.styleColor.rawValue).cgColor
+        drawLayer.setNeedsDisplay()
+
     }
 
     // 竖线恢复到原有色值