Fixed transform apply/reset for clipping (#175)

* Fixed transform apply/reset for clipping. Fix #136
This commit is contained in:
Igor Kiselev
2016-10-04 17:18:45 -07:00
committed by Anton Lavrenov
parent 630023b7e7
commit 330ab557ee
2 changed files with 108 additions and 2 deletions

View File

@@ -374,7 +374,9 @@
if (hasClip && layer) {
context.save();
layer._applyTransform(this, context);
var transform = this.getAbsoluteTransform(top);
var m = transform.getMatrix();
context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
context.beginPath();
if (clipFunc) {
clipFunc.call(this, context, this);
@@ -384,7 +386,8 @@
context.rect(clipX, clipY, clipWidth, clipHeight);
}
context.clip();
context.reset();
m = transform.copy().invert().getMatrix();
context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
}
this.children.each(function(child) {