Permalink
Browse files

Fixes Kanvas.currentTransform and video positioning

  • Loading branch information...
1 parent edbf0d2 commit 815e52380ec2a2bcfb46c97c886bb39fbff8a675 @yurydelendik yurydelendik committed Mar 18, 2013
View
Binary file not shown.
View
Binary file not shown.
View
@@ -224,8 +224,8 @@
ct.b = ctm[1] = h * a + j * b;
ct.c = ctm[2] = g * c + i * d;
ct.d = ctm[3] = h * c + j * d;
- ct.e = ctm[4] += ctm[0] * e + i * e;
- ct.f = ctm[5] += ctm[1] * f + j * f;
+ ct.e = ctm[4] += g * e + i * f;
+ ct.f = ctm[5] += h * e + j * f;
};
kanvas2dContextProto.setTransform = function (a, b, c, d, e, f) {
if (+a != a || +b != b || +c != c || +d != d || +e != e || +f != f)
View
@@ -38,19 +38,18 @@ var VideoDefinition = (function () {
ctx.clip();
ctx.clearRect(0, 0, this._videoWidth, this._videoHeight);
- ctx.save();
- ctx.scale(this._videoScaleX, this._videoScaleY);
var matrix = ctx.currentTransform;
- var cssTransform = "transform: matrix(" + matrix.a + ", " +
- matrix.b + ", " + matrix.c + ", " + matrix.d + ", " + matrix.e + ", " +
- matrix.f + ");";
+ var sx = this._videoScaleX, sy = this._videoScaleY;
+ var cssTransform = "transform: matrix(" + sx * matrix.a + ", " +
+ sx * matrix.b + ", " + sy * matrix.c + ", " + sy * matrix.d + ", " +
+ matrix.e + ", " + matrix.f + ");";
if (this._currentCssTransform !== cssTransform) {
this._currentCssTransform = cssTransform;
this._element.setAttribute("style", "position: absolute; top:0; left:0; z-index: -100;" +
- "transform-origin: 0px 0px 0;" + cssTransform);
+ "transform-origin: 0px 0px 0;" + cssTransform +
+ "-webkit-transform-origin: 0px 0px 0; -webkit-" + cssTransform);
this._markAsDirty();
}
- ctx.restore();
}
};

0 comments on commit 815e523

Please sign in to comment.