From 19cf8b6782b0d1245ae50d10140c44b0c4da4900 Mon Sep 17 00:00:00 2001 From: Morten Bek Ditlevsen Date: Thu, 18 Feb 2021 08:04:37 +0100 Subject: [PATCH] Made properties of CGPoint, CGSize and CGRect vars instead of lets. Initialized array used by CGAffineTransform concatenation (#382) --- Sources/TokamakCore/Stubs/CGStubs.swift | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Sources/TokamakCore/Stubs/CGStubs.swift b/Sources/TokamakCore/Stubs/CGStubs.swift index a2a528257..a67a28745 100644 --- a/Sources/TokamakCore/Stubs/CGStubs.swift +++ b/Sources/TokamakCore/Stubs/CGStubs.swift @@ -25,8 +25,8 @@ import WASILibc public typealias CGFloat = Double public struct CGPoint: Equatable { - public let x: CGFloat - public let y: CGFloat + public var x: CGFloat + public var y: CGFloat public init(x: CGFloat, y: CGFloat) { self.x = x @@ -55,8 +55,8 @@ public struct CGPoint: Equatable { } public struct CGSize: Equatable { - public let width: CGFloat - public let height: CGFloat + public var width: CGFloat + public var height: CGFloat public init(width: CGFloat, height: CGFloat) { self.width = width @@ -69,8 +69,8 @@ public struct CGSize: Equatable { } public struct CGRect: Equatable { - public let origin: CGPoint - public let size: CGSize + public var origin: CGPoint + public var size: CGSize public init(origin: CGPoint, size: CGSize) { self.origin = origin @@ -194,7 +194,9 @@ public struct CGAffineTransform: Equatable { let t2m = [[t2.a, t2.b, 0], [t2.c, t2.d, 0], [t2.tx, t2.ty, 1]] - var res = [[CGFloat]]() + var res: [[CGFloat]] = [[0, 0, 0], + [0, 0, 0], + [0, 0, 0]] for i in 0..<3 { for j in 0..<3 { res[i][j] = 0