diff --git a/CHANGELOG.md b/CHANGELOG.md index 634ec953..7068d957 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [2.5.0] +- Fix: textbox transform report newScaleX and newScaleY values [#5464](https://github.com/fabricjs/fabric.js/pull/5464) +- Fix: export of svg and gradient with transforms [#5456](https://github.com/fabricjs/fabric.js/pull/5456) +- Fix: detection of controls in perPixelTargetFind + cache [#5455](https://github.com/fabricjs/fabric.js/pull/5455) +- Add: added canvas.toCanvasElement method [#5452](https://github.com/fabricjs/fabric.js/pull/5452) + ## [2.4.6] - Fix: unbreak the svg export broken in 2.4.5 [#5438](https://github.com/fabricjs/fabric.js/pull/5438) diff --git a/HEADER.js b/HEADER.js index 937f69f1..181ae26e 100644 --- a/HEADER.js +++ b/HEADER.js @@ -1,6 +1,6 @@ /*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */ -var fabric = fabric || { version: '2.4.6' }; +var fabric = fabric || { version: '2.5.0' }; if (typeof exports !== 'undefined') { exports.fabric = fabric; } diff --git a/dist/fabric.js b/dist/fabric.js index 89fe5e79..a63c005e 100644 --- a/dist/fabric.js +++ b/dist/fabric.js @@ -1,7 +1,7 @@ /* build: `node build.js modules=ALL exclude=gestures,accessors requirejs minifier=uglifyjs` */ /*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */ -var fabric = fabric || { version: '2.4.6' }; +var fabric = fabric || { version: '2.5.0' }; if (typeof exports !== 'undefined') { exports.fabric = fabric; } @@ -5874,29 +5874,25 @@ fabric.ElementsParser = function(elements, callback, options, reviver, parsingOp var coords = clone(this.coords, true), i, len, markup, commonAttributes, colorStops = clone(this.colorStops, true), needsSwap = coords.r1 > coords.r2, - offsetX = object.width / 2, offsetY = object.height / 2; + transform = this.gradientTransform ? this.gradientTransform.concat() : fabric.iMatrix.concat(), + offsetX = object.width / 2 - this.offsetX, offsetY = object.height / 2 - this.offsetY; // colorStops must be sorted ascending colorStops.sort(function(a, b) { return a.offset - b.offset; }); + if (object.type === 'path') { offsetX -= object.pathOffset.x; offsetY -= object.pathOffset.y; } - for (var prop in coords) { - if (prop === 'x1' || prop === 'x2') { - coords[prop] += this.offsetX - offsetX; - } - else if (prop === 'y1' || prop === 'y2') { - coords[prop] += this.offsetY - offsetY; - } - } + + transform[4] -= offsetX; + transform[5] -= offsetY; commonAttributes = 'id="SVGID_' + this.id + '" gradientUnits="userSpaceOnUse"'; - if (this.gradientTransform) { - commonAttributes += ' gradientTransform="matrix(' + this.gradientTransform.join(' ') + ')" '; - } + commonAttributes += ' gradientTransform="matrix(' + transform.join(' ') + ')" '; + if (this.type === 'linear') { markup = [ '= t.getMinWidth()) { + scaled = w !== t.width; t.set('width', w); - return true; + return scaled; } } else {