Skip to content

Commit

Permalink
Merge pull request #2853 from asturur/textboxspaces
Browse files Browse the repository at this point in the history
Textboxspaces
  • Loading branch information
asturur committed Mar 27, 2016
2 parents 7059e34 + e3e8984 commit f1cd8bf
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/mixins/itext.svg_export.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @private
*/
_setSVGTextLineText: function(lineIndex, textSpans, height, textLeftOffset, textTopOffset, textBgRects) {
if (!this.styles[lineIndex]) {
if (!this.hasStyleOnLine(lineIndex)) {
fabric.Text.prototype._setSVGTextLineText.call(this,
lineIndex, textSpans, height, textLeftOffset, textTopOffset);
}
Expand Down
10 changes: 10 additions & 0 deletions src/shapes/itext.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,16 @@
}
},

/**
* This function is a TEMPORARY fix before restyling svg export
* and tspan generation
* @param {Number} lineIndex
* @private
*/
hasStyleOnLine: function(lineIndex) {
return this.styles[lineIndex];
},

/**
* @param {Number} lineIndex
* @param {Number} charIndex
Expand Down
17 changes: 17 additions & 0 deletions src/shapes/textbox.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,23 @@
return map;
},

/**
* This function is a TEMPORARY fix before restyling svg export
* and tspan generation
* @param {Number} lineIndex
* @private
*/
hasStyleOnLine: function(lineIndex) {
if (this._styleMap) {
var map = this._styleMap[lineIndex];
if (!map) {
return null;
}
lineIndex = map.line;
}
return this.styles[lineIndex];
},

/**
* @param {Number} lineIndex
* @param {Number} charIndex
Expand Down

0 comments on commit f1cd8bf

Please sign in to comment.