Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make properties of CGPoint, CGSize and CGRect vars instead of lets #382

Merged
merged 1 commit into from
Feb 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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