Better examples.
This commit is contained in:
parent
d1adfba46e
commit
a3491867ad
2 changed files with 12 additions and 20 deletions
16
README.md
16
README.md
|
@ -40,16 +40,12 @@ let
|
|||
y = 50.0
|
||||
w = 100.0
|
||||
h = 100.0
|
||||
nw = 25.0
|
||||
ne = 25.0
|
||||
se = 25.0
|
||||
sw = 25.0
|
||||
path.moveTo(x+nw, y)
|
||||
path.arcTo(x+w, y, x+w, y+h, ne)
|
||||
path.arcTo(x+w, y+h, x, y+h, se)
|
||||
path.arcTo(x, y+h, x, y, sw)
|
||||
path.arcTo(x, y, x+w, y, nw)
|
||||
path.closePath()
|
||||
r = 25.0
|
||||
path.moveTo(x+r, y)
|
||||
path.arcTo(x+w, y, x+w, y+h, r)
|
||||
path.arcTo(x+w, y+h, x, y+h, r)
|
||||
path.arcTo(x, y+h, x, y, r)
|
||||
path.arcTo(x, y, x+w, y, r)
|
||||
path.closePath()
|
||||
image.fillPath(path, rgba(255, 0, 0, 255))
|
||||
```
|
||||
|
|
|
@ -9,16 +9,12 @@ let
|
|||
y = 50.0
|
||||
w = 100.0
|
||||
h = 100.0
|
||||
nw = 25.0
|
||||
ne = 25.0
|
||||
se = 25.0
|
||||
sw = 25.0
|
||||
path.moveTo(x+nw, y)
|
||||
path.arcTo(x+w, y, x+w, y+h, ne)
|
||||
path.arcTo(x+w, y+h, x, y+h, se)
|
||||
path.arcTo(x, y+h, x, y, sw)
|
||||
path.arcTo(x, y, x+w, y, nw)
|
||||
path.closePath()
|
||||
r = 25.0
|
||||
path.moveTo(x+r, y)
|
||||
path.arcTo(x+w, y, x+w, y+h, r)
|
||||
path.arcTo(x+w, y+h, x, y+h, r)
|
||||
path.arcTo(x, y+h, x, y, r)
|
||||
path.arcTo(x, y, x+w, y, r)
|
||||
path.closePath()
|
||||
image.fillPath(path, rgba(255, 0, 0, 255))
|
||||
|
||||
|
|
Loading…
Reference in a new issue