on master help sign in
Fix move to have y-axis properly oriented.

Fix rotations (`degrees` and `turns` functions were broken because I used `Math.pi` instead of `Math.PI`...)

commite80f19b42396e0a16803717684640a557745b06c authorevancz <info@elm-lang.org> dateSat 23 Mar 2013, 13:20 (14 years ago) parentbbbd6ee
3 files changed+5−5
libraries/Native/Prelude.js+1−1 libraries/Prelude.elm+3−3 runtime/Render/Collage.js+1−1
libraries/Native/Prelude.js+1−1
@@ -73,7 +73,7 @@ Elm.Native.Prelude = function(elm) {
7373 rem:F2(rem),
7474 mod:F2(mod),
7575
76− pi:Math.pi,
76+ pi:Math.PI,
7777 e:Math.e,
7878 cos:Math.cos,
7979 sin:Math.sin,
libraries/Prelude.elm+3−3
@@ -7,10 +7,10 @@ radians : Float -> Float
77radians t = t
88
99degrees : Float -> Float
10−degrees d = Math.pi * d / 180
10+degrees d = d * Math.PI / 180
1111
12−rotations : Float -> Float
13−rotations r = 2 * Math.pi * r
12+turns : Float -> Float
13+turns r = 2 * Math.PI * r
1414
1515-- Integer division, remainder is discarded.
1616div : Int -> Int -> Int
runtime/Render/Collage.js+1−1
@@ -112,7 +112,7 @@ function drawImage(redo, ctx, form) {
112112
113113function renderForm(redo,ctx,form) {
114114 ctx.save();
115− if (form.x !== 0 || form.y !== 0) ctx.translate(form.x, form.y);
115+ if (form.x !== 0 || form.y !== 0) ctx.translate(form.x, -form.y);
116116 if (form.theta !== 0) ctx.rotate(form.theta);
117117 if (form.scale !== 1) ctx.scale(form.scale, form.scale);
118118 ctx.beginPath();