mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-13 08:13:13 +00:00
Fix path group toSvg method.
now respect current originX and originY
This commit is contained in:
parent
4ad253ffba
commit
08a1c6b418
2 changed files with 17 additions and 1 deletions
|
|
@ -149,7 +149,8 @@
|
|||
*/
|
||||
toSVG: function(reviver) {
|
||||
var objects = this.getObjects(),
|
||||
translatePart = 'translate(' + this.left + ' ' + this.top + ')',
|
||||
p = this.getPointByOrigin('left', 'top'),
|
||||
translatePart = 'translate(' + p.x + ' ' + p.y + ')',
|
||||
markup = [
|
||||
//jscs:disable validateIndentation
|
||||
'<g ',
|
||||
|
|
|
|||
|
|
@ -242,4 +242,19 @@
|
|||
start();
|
||||
});
|
||||
});
|
||||
|
||||
asyncTest('toSVGCenterOrigin', function() {
|
||||
ok(fabric.PathGroup);
|
||||
getPathGroupObject(function(pathGroup) {
|
||||
ok(typeof pathGroup.toSVG == 'function');
|
||||
pathGroup.originX = 'center';
|
||||
pathGroup.originY = 'center';
|
||||
pathGroup.width = 700;
|
||||
pathGroup.height = 600;
|
||||
pathGroup.left = 350;
|
||||
pathGroup.top = 300;
|
||||
equal(pathGroup.toSVG(), REFERENCE_PATH_GROUP_SVG);
|
||||
start();
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
|
|
|||
Loading…
Reference in a new issue