mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Refactoring
This commit is contained in:
parent
f675add6f9
commit
2d66131682
179 changed files with 691 additions and 467 deletions
|
|
@ -6,6 +6,9 @@ swift_library(
|
|||
srcs = glob([
|
||||
"Sources/**/*.swift",
|
||||
]),
|
||||
copts = [
|
||||
"-warnings-as-errors",
|
||||
],
|
||||
deps = [
|
||||
"//submodules/Display:Display",
|
||||
],
|
||||
|
|
|
|||
|
|
@ -216,7 +216,6 @@ class BarsComponentController: GeneralChartComponentController {
|
|||
}
|
||||
|
||||
override func showDetailsView(at chartPosition: CGFloat, detailsViewPosition: CGFloat, dataIndex: Int, date: Date, animated: Bool, feedback: Bool) {
|
||||
let rangeWithOffset = detailsViewPosition - barsWidth / currentHorizontalMainChartRange.distance * chartFrame().width / 2 + chartFrame().minX / 2
|
||||
super.showDetailsView(at: chartPosition, detailsViewPosition: detailsViewPosition, dataIndex: dataIndex, date: date, animated: animated, feedback: feedback)
|
||||
mainBarsRenderer.setSelectedIndex(dataIndex, animated: true)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import Cocoa
|
|||
import UIKit
|
||||
#endif
|
||||
|
||||
public protocol ChartViewRenderer: class {
|
||||
public protocol ChartViewRenderer: AnyObject {
|
||||
var containerViews: [GView] { get set }
|
||||
func render(context: CGContext, bounds: CGRect, chartFrame: CGRect)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,6 @@ class LinesChartRenderer: BaseChartRenderer {
|
|||
if linesShapeAnimator.isAnimating {
|
||||
let animationOffset = linesShapeAnimator.current
|
||||
|
||||
let path = CGMutablePath()
|
||||
let fromPoints = fromLines.safeElement(at: index)?.points ?? []
|
||||
let toPoints = toLines.safeElement(at: index)?.points ?? []
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class PecentChartRenderer: BaseChartRenderer {
|
|||
|
||||
let range = renderRange(bounds: bounds, chartFrame: chartFrame)
|
||||
|
||||
var paths: [CGMutablePath] = percentageData.components.map { _ in CGMutablePath() }
|
||||
let paths: [CGMutablePath] = percentageData.components.map { _ in CGMutablePath() }
|
||||
var vertices: [CGFloat] = Array<CGFloat>(repeating: 0, count: percentageData.components.count)
|
||||
|
||||
if var locationIndex = percentageData.locations.firstIndex(where: { $0 > range.lowerBound }) {
|
||||
|
|
|
|||
|
|
@ -125,7 +125,6 @@ class PercentPieAnimationRenderer: BaseChartRenderer {
|
|||
offset: animationFractionD)
|
||||
|
||||
let startDestinationPoint = lineCenterPoint + CGPoint(x: destinationRadius, y: 0)
|
||||
let centerDestinationPoint = lineCenterPoint + CGPoint(x: 0, y: destinationRadius)
|
||||
let endDestinationPoint = lineCenterPoint + CGPoint(x: -destinationRadius, y: 0)
|
||||
let initialStartDestinationAngle: CGFloat = 0
|
||||
let initialCenterDestinationAngle: CGFloat = .pi / 2
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import UIKit
|
|||
#endif
|
||||
import CoreGraphics
|
||||
|
||||
public protocol DisplayLinkListner: class {
|
||||
public protocol DisplayLinkListner: AnyObject {
|
||||
func update(delta: TimeInterval)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue