mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-25 16:04:42 +00:00
Allow to change number precision in sag transform values. Thanks Will McNeilly.
This commit is contained in:
parent
fd621c9844
commit
17fe1a2929
4 changed files with 15 additions and 11 deletions
8
dist/all.js
vendored
8
dist/all.js
vendored
|
|
@ -8073,10 +8073,12 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, {
|
|||
*/
|
||||
getSvgTransform: function() {
|
||||
var angle = this.getAngle();
|
||||
var NUM_FRACTION_DIGITS = fabric.Object.NUM_FRACTION_DIGITS;
|
||||
return [
|
||||
"translate(", toFixed(this.left, 2), " ", toFixed(this.top, 2), ")",
|
||||
angle !== 0 ? (" rotate(" + toFixed(angle, 2) + ")") : '',
|
||||
(this.scaleX === 1 && this.scaleY === 1) ? '' : (" scale(" + toFixed(this.scaleX, 2) + " " + toFixed(this.scaleY, 2) + ")")
|
||||
"translate(", toFixed(this.left, NUM_FRACTION_DIGITS), " ", toFixed(this.top, NUM_FRACTION_DIGITS), ")",
|
||||
angle !== 0 ? (" rotate(" + toFixed(angle, NUM_FRACTION_DIGITS) + ")") : '',
|
||||
(this.scaleX === 1 && this.scaleY === 1) ? '' : (" scale(" + toFixed(this.scaleX, NUM_FRACTION_DIGITS) +
|
||||
" " + toFixed(this.scaleY, NUM_FRACTION_DIGITS) + ")")
|
||||
].join('');
|
||||
},
|
||||
|
||||
|
|
|
|||
10
dist/all.min.js
vendored
10
dist/all.min.js
vendored
File diff suppressed because one or more lines are too long
BIN
dist/all.min.js.gz
vendored
BIN
dist/all.min.js.gz
vendored
Binary file not shown.
|
|
@ -363,10 +363,12 @@
|
|||
*/
|
||||
getSvgTransform: function() {
|
||||
var angle = this.getAngle();
|
||||
var NUM_FRACTION_DIGITS = fabric.Object.NUM_FRACTION_DIGITS;
|
||||
return [
|
||||
"translate(", toFixed(this.left, 2), " ", toFixed(this.top, 2), ")",
|
||||
angle !== 0 ? (" rotate(" + toFixed(angle, 2) + ")") : '',
|
||||
(this.scaleX === 1 && this.scaleY === 1) ? '' : (" scale(" + toFixed(this.scaleX, 2) + " " + toFixed(this.scaleY, 2) + ")")
|
||||
"translate(", toFixed(this.left, NUM_FRACTION_DIGITS), " ", toFixed(this.top, NUM_FRACTION_DIGITS), ")",
|
||||
angle !== 0 ? (" rotate(" + toFixed(angle, NUM_FRACTION_DIGITS) + ")") : '',
|
||||
(this.scaleX === 1 && this.scaleY === 1) ? '' : (" scale(" + toFixed(this.scaleX, NUM_FRACTION_DIGITS) +
|
||||
" " + toFixed(this.scaleY, NUM_FRACTION_DIGITS) + ")")
|
||||
].join('');
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue