Remove space at the bottom of containing box on text objects (with high line height). Fix underline/strike-through to work with line height correctly. Closes #608

This commit is contained in:
kangax 2013-05-21 13:16:26 +02:00
parent 05c0aed92f
commit 257d629575
4 changed files with 9 additions and 9 deletions

8
dist/all.js vendored
View file

@ -16647,7 +16647,7 @@ fabric.Image.filters.Pixelate.fromObject = function(object) {
ctx,
textLines[i],
this._getLeftOffset(),
this._getTopOffset() + (i * this.fontSize * this.lineHeight) + this.fontSize
this._getTopOffset() + ((i + 1) * this.fontSize * this.lineHeight)
);
}
}
@ -16673,7 +16673,7 @@ fabric.Image.filters.Pixelate.fromObject = function(object) {
ctx,
textLines[i],
this._getLeftOffset(),
this._getTopOffset() + (i * this.fontSize * this.lineHeight) + this.fontSize
this._getTopOffset() + ((i + 1) * this.fontSize * this.lineHeight)
);
}
ctx.closePath();
@ -16782,10 +16782,10 @@ fabric.Image.filters.Pixelate.fromObject = function(object) {
}
if (this.textDecoration.indexOf('underline') > -1) {
renderLinesAtOffset(this.fontSize);
renderLinesAtOffset(this.fontSize * this.lineHeight);
}
if (this.textDecoration.indexOf('line-through') > -1) {
renderLinesAtOffset(this.fontSize / 2);
renderLinesAtOffset((this.fontSize * this.lineHeight) - (this.fontSize / 2));
}
if (this.textDecoration.indexOf('overline') > -1) {
renderLinesAtOffset(0);

2
dist/all.min.js vendored

File diff suppressed because one or more lines are too long

BIN
dist/all.min.js.gz vendored

Binary file not shown.

View file

@ -478,7 +478,7 @@
ctx,
textLines[i],
this._getLeftOffset(),
this._getTopOffset() + (i * this.fontSize * this.lineHeight) + this.fontSize
this._getTopOffset() + ((i + 1) * this.fontSize * this.lineHeight)
);
}
}
@ -504,7 +504,7 @@
ctx,
textLines[i],
this._getLeftOffset(),
this._getTopOffset() + (i * this.fontSize * this.lineHeight) + this.fontSize
this._getTopOffset() + ((i + 1) * this.fontSize * this.lineHeight)
);
}
ctx.closePath();
@ -613,10 +613,10 @@
}
if (this.textDecoration.indexOf('underline') > -1) {
renderLinesAtOffset(this.fontSize);
renderLinesAtOffset(this.fontSize * this.lineHeight);
}
if (this.textDecoration.indexOf('line-through') > -1) {
renderLinesAtOffset(this.fontSize / 2);
renderLinesAtOffset((this.fontSize * this.lineHeight) - (this.fontSize / 2));
}
if (this.textDecoration.indexOf('overline') > -1) {
renderLinesAtOffset(0);