Skip to content

Commit

Permalink
Drop 0.5 support, fix some 0.7 deprecations (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
ararslan authored Apr 6, 2018
1 parent 3183be9 commit c7014e7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ os:
- linux
- osx
julia:
- 0.4
- 0.5
- 0.6
- nightly
notifications:
email: false
Expand Down
4 changes: 2 additions & 2 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
julia 0.5
julia 0.6
Colors
Compat 0.17.0
Compat 0.48.0
NaNMath 0.2.4
17 changes: 8 additions & 9 deletions src/Graphics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ __precompile__()

module Graphics

import Base: +, -, *, /, &, fill, norm
using Colors
using Compat
using Compat.LinearAlgebra
using Colors
using NaNMath

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

"""
Graphics defines an API for drawing in two dimensions.
Expand Down Expand Up @@ -98,7 +97,7 @@ export
Create a Cartesian representation `v` of a vector (or point) in two dimensions.
"""
immutable Vec2
struct Vec2
x::Float64
y::Float64
end
Expand Down Expand Up @@ -137,7 +136,7 @@ norm(p::Vec2) = hypot(p.x, p.y)
Create a representation `bb` of a rectangular region, specifying the
coordinates of the horizontal (x) and vertical (y) edges.
"""
immutable BoundingBox
struct BoundingBox
xmin::Float64
xmax::Float64
ymin::Float64
Expand Down Expand Up @@ -300,7 +299,7 @@ macro mustimplement(sig)
end

# a graphics output device; can create GraphicsContexts
@compat abstract type GraphicsDevice end
abstract type GraphicsDevice end

@mustimplement width(gd::GraphicsDevice)
@mustimplement height(gd::GraphicsDevice)
Expand All @@ -311,7 +310,7 @@ ymin(g::GraphicsDevice) = 0
ymax(g::GraphicsDevice) = height(g)

# an object that can actually be drawn to
@compat abstract type GraphicsContext end
abstract type GraphicsContext end

@mustimplement width(gc::GraphicsContext)
@mustimplement height(gc::GraphicsContext)
Expand Down
8 changes: 2 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using Graphics
if VERSION >= v"0.5.0-dev+7720"
using Base.Test
else
using BaseTestNext
const Test = BaseTestNext
end
using Compat
using Compat.Test

@testset "Geometry" begin
## Point-vector identity (typealias)
Expand Down

0 comments on commit c7014e7

Please sign in to comment.