@@ -51,13 +51,25 @@ ctx->lineTo(~x=1., ~y=2.)
51
51
ctx -> quadraticCurveTo (~cpx = 1 ., ~cpy = 1 ., ~x = 1 ., ~y = 1 .)
52
52
ctx -> bezierCurveTo (~cp1x = 1 ., ~cp1y = 1 ., ~cp2x = 2 ., ~cp2y = 2 ., ~x = 4 ., ~y = 4 .)
53
53
ctx -> arcTo (~x1 = 1 ., ~y1 = 1 ., ~x2 = 2 ., ~y2 = 2 ., ~r = 4 .)
54
- ctx -> arc (~x = 1 ., ~y = 1 ., ~r = 4 ., ~a1 = 1 ., ~a2 = 3 ., ~ccw = true , ())
54
+ ctx -> arc (~x = 1 ., ~y = 1 ., ~r = 4 ., ~startAngle = 1 ., ~endAngle = 3 ., ~counterClockWise = true , ())
55
+ ctx -> ellipse (
56
+ ~x = 1 .,
57
+ ~y = 1 .,
58
+ ~rx = 4 .,
59
+ ~ry = 8 .,
60
+ ~rtn = 4 .,
61
+ ~startAngle = 1 .,
62
+ ~endAngle = 3 .,
63
+ ~counterClockWise = true ,
64
+ (),
65
+ )
55
66
ctx -> rect (~x = 0 ., ~y = 0 ., ~w = 10 ., ~h = 10 .)
56
67
let pointInPath : bool = ctx -> isPointInPath (~x = 0 ., ~y = 0 .)
57
68
58
69
let linearGradient : gradient = ctx -> createLinearGradient (~x0 = 0.0 , ~y0 = 0.0 , ~x1 = 0.0 , ~y1 = 0.0 )
59
70
setStrokeStyle (ctx , Gradient , linearGradient )
60
- let radialGradient : gradient = ctx -> createRadialGradient (~x0 = 0.0 , ~y0 = 0.0 , ~x1 = 0.0 , ~y1 = 0.0 , ~r0 = 0.0 , ~r1 = 0.0 )
71
+ let radialGradient : gradient =
72
+ ctx -> createRadialGradient (~x0 = 0.0 , ~y0 = 0.0 , ~x1 = 0.0 , ~y1 = 0.0 , ~r0 = 0.0 , ~r1 = 0.0 )
61
73
linearGradient -> addColorStop (0.0 , "red" )
62
74
let noRepeatPatern : pattern = ctx -> createPattern (document -> Document .createElement ("img" ), #noRepeat )
63
75
let repeatPatern : pattern = ctx -> createPattern (document -> Document .createElement ("img" ), #repeat )
@@ -112,13 +124,14 @@ ctx->fillRect(~x=1., ~y=0., ~w=10., ~h=10.)
112
124
ctx -> strokeRect (~x = 1 ., ~y = 0 ., ~w = 10 ., ~h = 10 .)
113
125
ctx -> clearRect (~x = 1 ., ~y = 0 ., ~w = 10 ., ~h = 10 .)
114
126
115
-
116
127
let path1 = Path2d .make ()
117
- let path2 = Path2d .make (~d = "M24.85,10.126c2.018-4.783,6.628-8.125,11.99-8.125c7.223"
118
- ++ ",0,12.425,6.179,13.079,13.543 c0,0,0.353,1.828-0.424,5.119c-1.058,4.482"
119
- ++ "-3.545,8.464-6.898,11.503L24.85,48L7.402,32.165c-3.353-3.038-5.84-7.021"
120
- ++ "-6.898-11.503 c-0.777-3.291-0.424-5.119-0.424-5.119C0.734,8.179,5.936,2"
121
- ++ ",13.159,2C18.522,2,22.832,5.343,24.85,10.126z" ,())
128
+ let path2 = Path2d .make (
129
+ ~d = "M24.85,10.126c2.018-4.783,6.628-8.125,11.99-8.125c7.223" ++
130
+ ",0,12.425,6.179,13.079,13.543 c0,0,0.353,1.828-0.424,5.119c-1.058,4.482" ++
131
+ "-3.545,8.464-6.898,11.503L24.85,48L7.402,32.165c-3.353-3.038-5.84-7.021" ++
132
+ "-6.898-11.503 c-0.777-3.291-0.424-5.119-0.424-5.119C0.734,8.179,5.936,2" ++ ",13.159,2C18.522,2,22.832,5.343,24.85,10.126z" ,
133
+ (),
134
+ )
122
135
123
136
path1 -> Path2d .rect (~x = 1 ., ~y = 2 ., ~w = 10 ., ~h = 10 .)
124
137
path2 -> Path2d .bezierCurveTo (~cp1x = 1 ., ~cp1y = 2 ., ~cp2x = 2 ., ~cp2y = 2 ., ~x = 4 ., ~y = 4 .)
0 commit comments