Merge pull request #2020 from asturur/Fix-iText-position-bug-when-style-is-empty

Fix gradient for IText. Closes #2013
This commit is contained in:
Juriy Zaytsev 2015-03-07 17:48:47 +01:00
commit a13cca92d9
2 changed files with 3 additions and 3 deletions

View file

@ -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;

View file

@ -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;
}