Skip to content

Commit

Permalink
Fix the middleAt function.
Browse files Browse the repository at this point in the history
  • Loading branch information
process-bot committed Nov 25, 2012
1 parent fb3acd7 commit 87eaa91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core-js/Graphics/Render.js
Expand Up @@ -124,7 +124,7 @@ function setPos(pos,e) {
case "PositionAt":
e.style.top = toPos(pos[2]);
e.style.left = toPos(pos[1]);
var shift = "translate(" + (-elem[3]/2) + "px," + (-elem[4]/2) + "px)";
var shift = "translate(" + ~~(-e.style.width.slice(0,-2) / 2) + "px," + ~~(-e.style.height.slice(0,-2) / 2) + "px)";
e.style.transform = shift;
e.style.msTransform = shift;
e.style.MozTransform = shift;
Expand Down
4 changes: 3 additions & 1 deletion elm/elm-runtime-0.5.5.js
Expand Up @@ -2126,9 +2126,11 @@ function setPos(pos,e) {
if (pos[2][0] !== "Near") e.style.bottom = 0;
break;
case "PositionAt":
console.log(toPos(pos[1]),toPos(pos[2]));
e.style.top = toPos(pos[2]);
e.style.left = toPos(pos[1]);
var shift = "translate(" + (-elem[3]/2) + "px," + (-elem[4]/2) + "px)";
var shift = "translate(" + ~~(-e.style.width.slice(0,-2) / 2) + "px," + ~~(-e.style.height.slice(0,-2) / 2) + "px)";
console.log(shift);
e.style.transform = shift;
e.style.msTransform = shift;
e.style.MozTransform = shift;
Expand Down

0 comments on commit 87eaa91

Please sign in to comment.