mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-01 10:34:42 +00:00
Merge pull request #1660 from asturur/Fix-paths-toSVG
Update path.class.js
This commit is contained in:
commit
ad94d21541
1 changed files with 5 additions and 3 deletions
|
|
@ -537,19 +537,21 @@
|
|||
*/
|
||||
toSVG: function(reviver) {
|
||||
var chunks = [],
|
||||
markup = this._createBaseSVGMarkup();
|
||||
markup = this._createBaseSVGMarkup(), addTransform = '';
|
||||
|
||||
for (var i = 0, len = this.path.length; i < len; i++) {
|
||||
chunks.push(this.path[i].join(' '));
|
||||
}
|
||||
var path = chunks.join(' ');
|
||||
|
||||
if (!(this.group && this.group.type === 'path-group')) {
|
||||
addTransform = 'translate(' + (-this.width / 2) + ', ' + (-this.height / 2) + ')';
|
||||
}
|
||||
markup.push(
|
||||
//jscs:disable validateIndentation
|
||||
'<path ',
|
||||
'd="', path,
|
||||
'" style="', this.getSvgStyles(),
|
||||
'" transform="', this.getSvgTransform(),
|
||||
'" transform="', this.getSvgTransform(), addTransform,
|
||||
this.getSvgTransformMatrix(), '" stroke-linecap="round" ',
|
||||
'/>\n'
|
||||
//jscs:enable validateIndentation
|
||||
|
|
|
|||
Loading…
Reference in a new issue