Skip to content

Commit 20f1a56

Browse files
committed
Merge branch 'feature/TravisCI'
2 parents ad51627 + 32f0417 commit 20f1a56

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3125
-538
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
.build
22
Packages
3-
Cacao.xcodeproj
3+
Cacao.xcodeproj
4+
5+
*.xcuserstate
6+
*.xcworkspacedata
7+
*.xcuserdatad

Package.pins

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{
22
"autoPin": true,
33
"pins": [
4+
{
5+
"package": "Cairo",
6+
"reason": null,
7+
"repositoryURL": "https://github.com/PureSwift/Cairo.git",
8+
"version": "1.2.3"
9+
},
410
{
511
"package": "CCairo",
612
"reason": null,
@@ -17,7 +23,7 @@
1723
"package": "CFreeType",
1824
"reason": null,
1925
"repositoryURL": "https://github.com/PureSwift/CFreeType.git",
20-
"version": "1.0.3"
26+
"version": "1.0.4"
2127
},
2228
{
2329
"package": "CLCMS",
@@ -32,22 +38,22 @@
3238
"version": "1.0.1"
3339
},
3440
{
35-
"package": "Cairo",
41+
"package": "LittleCMS",
3642
"reason": null,
37-
"repositoryURL": "https://github.com/PureSwift/Cairo.git",
38-
"version": "1.2.2"
43+
"repositoryURL": "https://github.com/PureSwift/LittleCMS.git",
44+
"version": "1.0.2"
3945
},
4046
{
41-
"package": "LittleCMS",
47+
"package": "SDL",
4248
"reason": null,
43-
"repositoryURL": "https://github.com/PureSwift/LittleCMS.git",
49+
"repositoryURL": "https://github.com/PureSwift/SDL.git",
4450
"version": "1.0.1"
4551
},
4652
{
4753
"package": "Silica",
4854
"reason": null,
4955
"repositoryURL": "https://github.com/PureSwift/Silica.git",
50-
"version": "1.2.0"
56+
"version": "1.3.1"
5157
}
5258
],
5359
"version": 1

Package.resolved

Lines changed: 33 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,23 @@
1-
// swift-tools-version:4.0
1+
// swift-tools-version:3.0.2
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

66
let package = Package(
77
name: "Cacao",
8-
/*exclude: ["Resources"],*/
9-
products: [
10-
// Products define the executables and libraries produced by a package, and make them visible to other packages.
11-
.library(
12-
name: "Cacao",
13-
targets: ["Cacao"]
14-
),
15-
.executable(
16-
name: "CacaoDemo",
17-
targets: ["CacaoDemo"]
18-
)
19-
],
8+
targets: [
9+
Target(
10+
name: "CacaoDemo",
11+
dependencies: [.Target(name: "Cacao")]),
12+
Target(
13+
name: "Cacao"
14+
)
15+
],
2016
dependencies: [
21-
.package(url: "https://github.com/PureSwift/CSDL2.git", .branch("master")),
22-
.package(url: "https://github.com/PureSwift/SDL.git", .branch("master")),
23-
.package(url: "https://github.com/PureSwift/Silica.git", .branch("master")),
24-
.package(url: "https://github.com/PureSwift/Cairo.git", .branch("master"))
17+
.Package(url: "https://github.com/PureSwift/Silica.git", majorVersion: 1),
18+
.Package(url: "https://github.com/PureSwift/Cairo.git", majorVersion: 1),
19+
.Package(url: "https://github.com/PureSwift/SDL.git", majorVersion: 1),
20+
.Package(url: "https://github.com/PureSwift/CSDL2.git", majorVersion: 1)
2521
],
26-
targets: [
27-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
28-
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
29-
.target(
30-
name: "Cacao",
31-
dependencies: ["Cairo", "Silica", "SDL"]),
32-
.target(
33-
name: "CacaoDemo",
34-
dependencies: ["Cacao"]),
35-
.testTarget(
36-
name: "CacaoTests",
37-
dependencies: ["Cacao"])
38-
]
22+
exclude: ["iOS", "Resources"]
3923
)

Sources/Cacao/CADisplayLink.swift

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//
2+
// CADisplayLink.swift
3+
// Cacao
4+
//
5+
// Created by Alsey Coleman Miller on 11/19/17.
6+
//
7+
8+
import Foundation
9+
10+
/// A timer object that allows your application to synchronize its drawing to the refresh rate of the display.
11+
public final class CADisplayLink {
12+
13+
public typealias Action = (CADisplayLink) -> ()
14+
15+
public let action: Action
16+
17+
/// A Boolean value that states whether the display link’s notifications to the target are suspended.
18+
///
19+
/// The default value is false. If true, the display link does not send notifications to the target.
20+
/// `isPaused` is thread safe meaning that it can be set from a thread separate to the one in which
21+
/// the display link is running.
22+
public var isPaused: Bool = false
23+
24+
public init(action: @escaping Action) {
25+
26+
self.action = action
27+
}
28+
}

Sources/Cacao/NSStringDrawing.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ public extension String {
3939

4040
let descender = (CGFloat(font.cgFont.scaledFont.descent) * font.pointSize) / CGFloat(font.cgFont.scaledFont.unitsPerEm)
4141

42-
textFrame.size.height -= descender
42+
43+
textFrame.size.height = textFrame.size.height - descender
44+
//textFrame.size.height -= descender // Swift 3 error
4345

4446
return textFrame
4547
}

0 commit comments

Comments
 (0)