Skip to content

Commit

Permalink
Fix field name consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
paf31 committed Jun 20, 2018
1 parent e917c40 commit bbdc023
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 24 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

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

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
4 changes: 2 additions & 2 deletions generated-docs/Graphics/Canvas.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Opaque object for drawing elements and things to the canvas.
#### `Arc`

``` purescript
type Arc = { x :: Number, y :: Number, r :: Number, start :: Number, end :: Number }
type Arc = { x :: Number, y :: Number, radius :: Number, start :: Number, end :: Number }
```

A type representing an arc object:
Expand Down Expand Up @@ -124,7 +124,7 @@ Enumerates the different types of line join
#### `Rectangle`

``` purescript
type Rectangle = { x :: Number, y :: Number, w :: Number, h :: Number }
type Rectangle = { x :: Number, y :: Number, width :: Number, height :: Number }
```

A type representing a rectangle object:
Expand Down
18 changes: 5 additions & 13 deletions src/Graphics/Canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,39 +230,39 @@ exports.closePath = function(ctx) {
exports.arc = function(ctx) {
return function(a) {
return function() {
ctx.arc(a.x, a.y, a.r, a.start, a.end);
ctx.arc(a.x, a.y, a.radius, a.start, a.end);
};
};
};

exports.rect = function(ctx) {
return function(r) {
return function() {
ctx.rect(r.x, r.y, r.w, r.h);
ctx.rect(r.x, r.y, r.width, r.height);
};
};
};

exports.fillRect = function(ctx) {
return function(r) {
return function() {
ctx.fillRect(r.x, r.y, r.w, r.h);
ctx.fillRect(r.x, r.y, r.width, r.height);
};
};
};

exports.strokeRect = function(ctx) {
return function(r) {
return function() {
ctx.strokeRect(r.x, r.y, r.w, r.h);
ctx.strokeRect(r.x, r.y, r.width, r.height);
};
};
};

exports.clearRect = function(ctx) {
return function(r) {
return function() {
ctx.clearRect(r.x, r.y, r.w, r.h);
ctx.clearRect(r.x, r.y, r.width, r.height);
};
};
};
Expand Down Expand Up @@ -307,14 +307,6 @@ exports.setTransform = function(ctx) {
};
};

exports.clearRect = function(ctx) {
return function(r) {
return function() {
ctx.clearRect(r.x, r.y, r.w, r.h);
};
};
};

exports.textAlignImpl = function(ctx) {
return function() {
return ctx.textAlign;
Expand Down
17 changes: 9 additions & 8 deletions src/Graphics/Canvas.purs
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,12 @@ tryLoadImage
-> Effect Unit
tryLoadImage path k = tryLoadImageImpl path (k Nothing) (k <<< Just)

foreign import getCanvasElementByIdImpl ::
forall r. Fn3 String
(CanvasElement -> r)
r
(Effect r)
foreign import getCanvasElementByIdImpl
:: forall r
. Fn3 String
(CanvasElement -> r)
r
(Effect r)

-- | Get a canvas element by ID, or `Nothing` if the element does not exist.
getCanvasElementById :: String -> Effect (Maybe CanvasElement)
Expand Down Expand Up @@ -409,7 +410,7 @@ fillPath ctx path = do
type Arc =
{ x :: Number
, y :: Number
, r :: Number
, radius :: Number
, start :: Number
, end :: Number
}
Expand All @@ -424,8 +425,8 @@ foreign import arc :: Context2D -> Arc -> Effect Unit
type Rectangle =
{ x :: Number
, y :: Number
, w :: Number
, h :: Number
, width :: Number
, height :: Number
}

-- | Render a rectangle.
Expand Down

0 comments on commit bbdc023

Please sign in to comment.