Refactoring

This commit is contained in:
Ali 2021-08-04 01:30:57 +02:00
parent f675add6f9
commit 2d66131682
179 changed files with 691 additions and 467 deletions

View file

@ -6,6 +6,9 @@ swift_library(
srcs = glob([
"Sources/**/*.swift",
]),
copts = [
"-warnings-as-errors",
],
deps = [
"//submodules/Display:Display",
],

View file

@ -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)
}

View file

@ -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)
}

View file

@ -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 ?? []

View file

@ -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 }) {

View file

@ -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

View file

@ -14,7 +14,7 @@ import UIKit
#endif
import CoreGraphics
public protocol DisplayLinkListner: class {
public protocol DisplayLinkListner: AnyObject {
func update(delta: TimeInterval)
}