Skip to content

Commit c7014e7

Browse files
authored
Drop 0.5 support, fix some 0.7 deprecations (#13)
1 parent 3183be9 commit c7014e7

4 files changed

Lines changed: 13 additions & 19 deletions

File tree

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ os:
33
- linux
44
- osx
55
julia:
6-
- 0.4
7-
- 0.5
6+
- 0.6
87
- nightly
98
notifications:
109
email: false

REQUIRE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
julia 0.5
1+
julia 0.6
22
Colors
3-
Compat 0.17.0
3+
Compat 0.48.0
44
NaNMath 0.2.4

src/Graphics.jl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ __precompile__()
22

33
module Graphics
44

5-
import Base: +, -, *, /, &, fill, norm
6-
using Colors
75
using Compat
6+
using Compat.LinearAlgebra
7+
using Colors
88
using NaNMath
99

10-
if isdefined(Base, :scale)
11-
import Base: scale
12-
end
10+
import Base: +, -, *, /, &, fill
11+
import Compat.LinearAlgebra: norm
1312

1413
"""
1514
Graphics defines an API for drawing in two dimensions.
@@ -98,7 +97,7 @@ export
9897
9998
Create a Cartesian representation `v` of a vector (or point) in two dimensions.
10099
"""
101-
immutable Vec2
100+
struct Vec2
102101
x::Float64
103102
y::Float64
104103
end
@@ -137,7 +136,7 @@ norm(p::Vec2) = hypot(p.x, p.y)
137136
Create a representation `bb` of a rectangular region, specifying the
138137
coordinates of the horizontal (x) and vertical (y) edges.
139138
"""
140-
immutable BoundingBox
139+
struct BoundingBox
141140
xmin::Float64
142141
xmax::Float64
143142
ymin::Float64
@@ -300,7 +299,7 @@ macro mustimplement(sig)
300299
end
301300

302301
# a graphics output device; can create GraphicsContexts
303-
@compat abstract type GraphicsDevice end
302+
abstract type GraphicsDevice end
304303

305304
@mustimplement width(gd::GraphicsDevice)
306305
@mustimplement height(gd::GraphicsDevice)
@@ -311,7 +310,7 @@ ymin(g::GraphicsDevice) = 0
311310
ymax(g::GraphicsDevice) = height(g)
312311

313312
# an object that can actually be drawn to
314-
@compat abstract type GraphicsContext end
313+
abstract type GraphicsContext end
315314

316315
@mustimplement width(gc::GraphicsContext)
317316
@mustimplement height(gc::GraphicsContext)

test/runtests.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
using Graphics
2-
if VERSION >= v"0.5.0-dev+7720"
3-
using Base.Test
4-
else
5-
using BaseTestNext
6-
const Test = BaseTestNext
7-
end
2+
using Compat
3+
using Compat.Test
84

95
@testset "Geometry" begin
106
## Point-vector identity (typealias)

0 commit comments

Comments
 (0)