@@ -48,16 +48,28 @@ ctx->stroke
4848ctx -> clip
4949ctx -> moveTo (~x = 1 ., ~y = 1 .)
5050ctx -> lineTo (~x = 1 ., ~y = 2 .)
51- ctx -> quadraticCurveTo (~cp1x = 1 ., ~cp1y = 1 ., ~x = 1 ., ~y = 1 .)
51+ ctx -> quadraticCurveTo (~cpx = 1 ., ~cpy = 1 ., ~x = 1 ., ~y = 1 .)
5252ctx -> bezierCurveTo (~cp1x = 1 ., ~cp1y = 1 ., ~cp2x = 2 ., ~cp2y = 2 ., ~x = 4 ., ~y = 4 .)
5353ctx -> arcTo (~x1 = 1 ., ~y1 = 1 ., ~x2 = 2 ., ~y2 = 2 ., ~r = 4 .)
54- ctx -> arc (~x = 1 ., ~y = 1 ., ~r = 4 ., ~startAngle = 1 ., ~endAngle = 3 ., ~anticw = 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+ )
5566ctx -> rect (~x = 0 ., ~y = 0 ., ~w = 10 ., ~h = 10 .)
5667let pointInPath : bool = ctx -> isPointInPath (~x = 0 ., ~y = 0 .)
5768
5869let linearGradient : gradient = ctx -> createLinearGradient (~x0 = 0.0 , ~y0 = 0.0 , ~x1 = 0.0 , ~y1 = 0.0 )
5970setStrokeStyle (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 )
6173linearGradient -> addColorStop (0.0 , "red" )
6274let noRepeatPatern : pattern = ctx -> createPattern (document -> Document .createElement ("img" ), #noRepeat )
6375let repeatPatern : pattern = ctx -> createPattern (document -> Document .createElement ("img" ), #repeat )
@@ -111,12 +123,3 @@ ctx->strokeText("hi", ~x=1., ~y=0., ())
111123ctx -> fillRect (~x = 1 ., ~y = 0 ., ~w = 10 ., ~h = 10 .)
112124ctx -> strokeRect (~x = 1 ., ~y = 0 ., ~w = 10 ., ~h = 10 .)
113125ctx -> clearRect (~x = 1 ., ~y = 0 ., ~w = 10 ., ~h = 10 .)
114-
115- let path : path2d = newPath2D ("M24.85,10.126c2.018-4.783,6.628-8.125,11.99-8.125c7.223"
116- ++ ",0,12.425,6.179,13.079,13.543 c0,0,0.353,1.828-0.424,5.119c-1.058,4.482"
117- ++ "-3.545,8.464-6.898,11.503L24.85,48L7.402,32.165c-3.353-3.038-5.84-7.021"
118- ++ "-6.898-11.503 c-0.777-3.291-0.424-5.119-0.424-5.119C0.734,8.179,5.936,2"
119- ++ ",13.159,2C18.522,2,22.832,5.343,24.85,10.126z" )
120- ctx -> beginPath
121- ctx -> strokePath2D (path )
122- ctx -> fillPath2D (path )
0 commit comments