|
@@ -58,7 +58,6 @@ class PQStuckPointCuttingView: UIView {
|
|
private var oneMarginTime: CGFloat = 0
|
|
private var oneMarginTime: CGFloat = 0
|
|
|
|
|
|
private var isDrawLine: Bool = false
|
|
private var isDrawLine: Bool = false
|
|
- private var startDraw = true
|
|
|
|
|
|
|
|
// 保存已经绘制的竖线用于变色使用
|
|
// 保存已经绘制的竖线用于变色使用
|
|
var lineLayerArray: Array = Array<CAShapeLayer>.init()
|
|
var lineLayerArray: Array = Array<CAShapeLayer>.init()
|
|
@@ -297,18 +296,6 @@ class PQStuckPointCuttingView: UIView {
|
|
}
|
|
}
|
|
|
|
|
|
let startIndex = scrollView.contentOffset.x / (frequencyWidth + frequencyMargin)
|
|
let startIndex = scrollView.contentOffset.x / (frequencyWidth + frequencyMargin)
|
|
- if startDraw { // 第一个波纹
|
|
|
|
- startDraw = false
|
|
|
|
- let selectIndex = Int(ceil(startIndex))
|
|
|
|
- if(selectIndex < lineLayerArray.count){
|
|
|
|
- let drawLayer:CAShapeLayer = lineLayerArray[selectIndex]
|
|
|
|
- if drawLayer.strokeColor != UIColor.hexColor(hexadecimal: PQBFConfig.shared.styleColor.rawValue).cgColor{
|
|
|
|
- drawLayer.strokeColor = UIColor.hexColor(hexadecimal: PQBFConfig.shared.styleColor.rawValue).cgColor
|
|
|
|
- drawLayer.setNeedsDisplay()
|
|
|
|
- drawLayer.layoutIfNeeded()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
let selectIndex = Int(ceil(startIndex + progress * CGFloat(wavSelectCount)))
|
|
let selectIndex = Int(ceil(startIndex + progress * CGFloat(wavSelectCount)))
|
|
if(selectIndex < lineLayerArray.count){
|
|
if(selectIndex < lineLayerArray.count){
|
|
let drawLayer:CAShapeLayer = lineLayerArray[selectIndex]
|
|
let drawLayer:CAShapeLayer = lineLayerArray[selectIndex]
|
|
@@ -330,8 +317,6 @@ class PQStuckPointCuttingView: UIView {
|
|
|
|
|
|
// 竖线恢复到原有色值
|
|
// 竖线恢复到原有色值
|
|
func resetDefaultsColor(clearData:Bool = true) {
|
|
func resetDefaultsColor(clearData:Bool = true) {
|
|
- startDraw = false
|
|
|
|
-
|
|
|
|
for layer in lineLayerArray {
|
|
for layer in lineLayerArray {
|
|
layer.strokeColor = UIColor.hexColor(hexadecimal: "#999999").cgColor
|
|
layer.strokeColor = UIColor.hexColor(hexadecimal: "#999999").cgColor
|
|
layer.setNeedsDisplay()
|
|
layer.setNeedsDisplay()
|