@@ -2,14 +2,13 @@ __precompile__()
22
33module Graphics
44
5- import Base: + , - , * , / , & , fill, norm
6- using Colors
75using Compat
6+ using Compat. LinearAlgebra
7+ using Colors
88using NaNMath
99
10- if isdefined (Base, :scale )
11- import Base: scale
12- end
10+ import Base: + , - , * , / , & , fill
11+ import Compat. LinearAlgebra: norm
1312
1413"""
1514Graphics defines an API for drawing in two dimensions.
9897
9998Create 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
104103end
@@ -137,7 +136,7 @@ norm(p::Vec2) = hypot(p.x, p.y)
137136Create a representation `bb` of a rectangular region, specifying the
138137coordinates 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)
300299end
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
311310ymax (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 )
0 commit comments