mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-13 10:50:59 +00:00
ToSVG respects viewport transformation
This commit is contained in:
parent
77811aa4bc
commit
fc0dd0377a
1 changed files with 5 additions and 2 deletions
|
|
@ -47,6 +47,9 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
|
|||
var toFixed = fabric.util.toFixed,
|
||||
angle = this.getAngle(),
|
||||
center = this.getCenterPoint(),
|
||||
vpt = this.getViewportTransform();
|
||||
|
||||
center = fabric.util.transformPoint(center, vpt);
|
||||
|
||||
NUM_FRACTION_DIGITS = fabric.Object.NUM_FRACTION_DIGITS,
|
||||
|
||||
|
|
@ -63,9 +66,9 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
|
|||
scalePart = (this.scaleX === 1 && this.scaleY === 1)
|
||||
? '' :
|
||||
(' scale(' +
|
||||
toFixed(this.scaleX, NUM_FRACTION_DIGITS) +
|
||||
toFixed(this.scaleX * vpt[0], NUM_FRACTION_DIGITS) +
|
||||
' ' +
|
||||
toFixed(this.scaleY, NUM_FRACTION_DIGITS) +
|
||||
toFixed(this.scaleY * vpt[3], NUM_FRACTION_DIGITS) +
|
||||
')'),
|
||||
|
||||
flipXPart = this.flipX ? 'matrix(-1 0 0 1 0 0) ' : '',
|
||||
|
|
|
|||
Loading…
Reference in a new issue