mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-25 13:43:44 +00:00
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:
commit
a13cca92d9
2 changed files with 3 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue