Skip to content

Commit bbdc023

Browse files
committed
Fix field name consistency
1 parent e917c40 commit bbdc023

File tree

4 files changed

+17
-24
lines changed

4 files changed

+17
-24
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014-17 Phil Freeman and other contributors
3+
Copyright (c) 2014-18 Phil Freeman and other contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of
66
this software and associated documentation files (the "Software"), to deal in

generated-docs/Graphics/Canvas.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Opaque object for drawing elements and things to the canvas.
3838
#### `Arc`
3939

4040
``` purescript
41-
type Arc = { x :: Number, y :: Number, r :: Number, start :: Number, end :: Number }
41+
type Arc = { x :: Number, y :: Number, radius :: Number, start :: Number, end :: Number }
4242
```
4343

4444
A type representing an arc object:
@@ -124,7 +124,7 @@ Enumerates the different types of line join
124124
#### `Rectangle`
125125

126126
``` purescript
127-
type Rectangle = { x :: Number, y :: Number, w :: Number, h :: Number }
127+
type Rectangle = { x :: Number, y :: Number, width :: Number, height :: Number }
128128
```
129129

130130
A type representing a rectangle object:

src/Graphics/Canvas.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -230,39 +230,39 @@ exports.closePath = function(ctx) {
230230
exports.arc = function(ctx) {
231231
return function(a) {
232232
return function() {
233-
ctx.arc(a.x, a.y, a.r, a.start, a.end);
233+
ctx.arc(a.x, a.y, a.radius, a.start, a.end);
234234
};
235235
};
236236
};
237237

238238
exports.rect = function(ctx) {
239239
return function(r) {
240240
return function() {
241-
ctx.rect(r.x, r.y, r.w, r.h);
241+
ctx.rect(r.x, r.y, r.width, r.height);
242242
};
243243
};
244244
};
245245

246246
exports.fillRect = function(ctx) {
247247
return function(r) {
248248
return function() {
249-
ctx.fillRect(r.x, r.y, r.w, r.h);
249+
ctx.fillRect(r.x, r.y, r.width, r.height);
250250
};
251251
};
252252
};
253253

254254
exports.strokeRect = function(ctx) {
255255
return function(r) {
256256
return function() {
257-
ctx.strokeRect(r.x, r.y, r.w, r.h);
257+
ctx.strokeRect(r.x, r.y, r.width, r.height);
258258
};
259259
};
260260
};
261261

262262
exports.clearRect = function(ctx) {
263263
return function(r) {
264264
return function() {
265-
ctx.clearRect(r.x, r.y, r.w, r.h);
265+
ctx.clearRect(r.x, r.y, r.width, r.height);
266266
};
267267
};
268268
};
@@ -307,14 +307,6 @@ exports.setTransform = function(ctx) {
307307
};
308308
};
309309

310-
exports.clearRect = function(ctx) {
311-
return function(r) {
312-
return function() {
313-
ctx.clearRect(r.x, r.y, r.w, r.h);
314-
};
315-
};
316-
};
317-
318310
exports.textAlignImpl = function(ctx) {
319311
return function() {
320312
return ctx.textAlign;

src/Graphics/Canvas.purs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,12 @@ tryLoadImage
153153
-> Effect Unit
154154
tryLoadImage path k = tryLoadImageImpl path (k Nothing) (k <<< Just)
155155

156-
foreign import getCanvasElementByIdImpl ::
157-
forall r. Fn3 String
158-
(CanvasElement -> r)
159-
r
160-
(Effect r)
156+
foreign import getCanvasElementByIdImpl
157+
:: forall r
158+
. Fn3 String
159+
(CanvasElement -> r)
160+
r
161+
(Effect r)
161162

162163
-- | Get a canvas element by ID, or `Nothing` if the element does not exist.
163164
getCanvasElementById :: String -> Effect (Maybe CanvasElement)
@@ -409,7 +410,7 @@ fillPath ctx path = do
409410
type Arc =
410411
{ x :: Number
411412
, y :: Number
412-
, r :: Number
413+
, radius :: Number
413414
, start :: Number
414415
, end :: Number
415416
}
@@ -424,8 +425,8 @@ foreign import arc :: Context2D -> Arc -> Effect Unit
424425
type Rectangle =
425426
{ x :: Number
426427
, y :: Number
427-
, w :: Number
428-
, h :: Number
428+
, width :: Number
429+
, height :: Number
429430
}
430431

431432
-- | Render a rectangle.

0 commit comments

Comments
 (0)