diff --git a/src/gradient.class.js b/src/gradient.class.js index 3f3b9cfb..49a8a863 100644 --- a/src/gradient.class.js +++ b/src/gradient.class.js @@ -258,7 +258,7 @@ } } - if (object.type === 'text') { + if (object.type === 'text' || object.type === 'i-text') { for (prop in coords) { if (prop === 'x1' || prop === 'x2') { coords[prop] -= object.width / 2; diff --git a/src/shapes/itext.class.js b/src/shapes/itext.class.js index 7d5101fd..b3f3fbeb 100644 --- a/src/shapes/itext.class.js +++ b/src/shapes/itext.class.js @@ -860,12 +860,12 @@ var fill = styleDeclaration.fill || this.fill; ctx.fillStyle = fill.toLive - ? fill.toLive(ctx) + ? fill.toLive(ctx, this) : fill; if (styleDeclaration.stroke) { ctx.strokeStyle = (styleDeclaration.stroke && styleDeclaration.stroke.toLive) - ? styleDeclaration.stroke.toLive(ctx) + ? styleDeclaration.stroke.toLive(ctx, this) : styleDeclaration.stroke; }