Skip to content

Commit

Permalink
Made properties of CGPoint, CGSize and CGRect vars instead of lets. I…
Browse files Browse the repository at this point in the history
…nitialized array used by CGAffineTransform concatenation (#382)
  • Loading branch information
mortenbekditlevsen authored Feb 18, 2021
1 parent eeddfe9 commit 19cf8b6
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Sources/TokamakCore/Stubs/CGStubs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 19cf8b6

Please sign in to comment.