mirror of
https://github.com/konvajs/konva.git
synced 2026-01-23 21:34:50 +08:00
Fixed transform apply/reset for clipping (#175)
* Fixed transform apply/reset for clipping. Fix #136
This commit is contained in:
committed by
Anton Lavrenov
parent
630023b7e7
commit
330ab557ee
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user