mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Various fixes
This commit is contained in:
@@ -72,6 +72,9 @@ public final class AudioWaveformComponent: Component {
|
||||
var foregroundColor: UIColor
|
||||
}
|
||||
|
||||
public final class CloneLayer: SimpleLayer {
|
||||
}
|
||||
|
||||
private final class LayerImpl: SimpleLayer {
|
||||
private var shimmerNode: ShimmerEffectNode?
|
||||
private var shimmerMask: SimpleLayer?
|
||||
@@ -158,6 +161,22 @@ public final class AudioWaveformComponent: Component {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
weak var cloneLayer: CloneLayer? {
|
||||
didSet {
|
||||
if let cloneLayer = self.cloneLayer {
|
||||
cloneLayer.contents = self.contents
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public var contents: Any? {
|
||||
didSet {
|
||||
if let cloneLayer = self.cloneLayer {
|
||||
cloneLayer.contents = self.contents
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public static var layerClass: AnyClass {
|
||||
@@ -224,6 +243,12 @@ public final class AudioWaveformComponent: Component {
|
||||
self.statusDisposable?.dispose()
|
||||
}
|
||||
|
||||
public var cloneLayer: CloneLayer? {
|
||||
didSet {
|
||||
(self.layer as! LayerImpl).cloneLayer = self.cloneLayer
|
||||
}
|
||||
}
|
||||
|
||||
@objc private func panGesture(_ recognizer: UIPanGestureRecognizer) {
|
||||
var location = recognizer.location(in: self)
|
||||
location.x -= self.bounds.minX
|
||||
@@ -392,7 +417,7 @@ public final class AudioWaveformComponent: Component {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override public func draw(_ rect: CGRect) {
|
||||
guard let component = self.component else {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user