Skip to content

Commit

Permalink
buil 245 (#5426)
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur authored Dec 10, 2018
1 parent aadfea0 commit 8a15902
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 19 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [2.4.5]
- Fix: svg import/export for canvas+clipPath and letterspacing. [#5424](https://github.com/fabricjs/fabric.js/pull/5424)
- Fix: avoid stroke dash from group selection to leak on upper canvas [#5392](https://github.com/fabricjs/fabric.js/pull/5392)

## [2.4.4]
- Fix: add clipPath to stateful cache check. [#5384](https://github.com/fabricjs/fabric.js/pull/5384)
- Fix: restore draggability of small objects [#5379](https://github.com/fabricjs/fabric.js/pull/5379)
Expand Down
2 changes: 1 addition & 1 deletion HEADER.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */

var fabric = fabric || { version: '2.4.4' };
var fabric = fabric || { version: '2.4.5' };
if (typeof exports !== 'undefined') {
exports.fabric = fabric;
}
Expand Down
36 changes: 20 additions & 16 deletions dist/fabric.js
Original file line number Diff line number Diff line change
@@ -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.4' };
var fabric = fabric || { version: '2.4.5' };
if (typeof exports !== 'undefined') {
exports.fabric = fabric;
}
Expand Down Expand Up @@ -3433,9 +3433,7 @@ if (typeof console !== 'undefined') {
value = null;
}
else {
value = value.replace(/,/g, ' ').split(/\s+/).map(function(n) {
return parseFloat(n);
});
value = value.replace(/,/g, ' ').split(/\s+/).map(parseFloat);
}
}
else if (attr === 'transformMatrix') {
Expand Down Expand Up @@ -3478,6 +3476,9 @@ if (typeof console !== 'undefined') {
value = 'stroke';
}
}
else if (attr === 'href' || attr === 'xlink:href') {
return value;
}
else {
parsed = isArray ? value.map(parseUnit) : parseUnit(value, fontSize);
}
Expand Down Expand Up @@ -4169,7 +4170,7 @@ if (typeof console !== 'undefined') {

var value,
parentAttributes = { },
fontSize;
fontSize, parentFontSize;

if (typeof svgUid === 'undefined') {
svgUid = element.getAttribute('svgUid');
Expand All @@ -4191,8 +4192,11 @@ if (typeof console !== 'undefined') {
ownAttributes = extend(ownAttributes,
extend(getGlobalStylesForElement(element, svgUid), fabric.parseStyleAttribute(element)));

fontSize = (parentAttributes && parentAttributes.fontSize ) ||
ownAttributes['font-size'] || fabric.Text.DEFAULT_SVG_FONT_SIZE;
fontSize = parentFontSize = parentAttributes.fontSize || fabric.Text.DEFAULT_SVG_FONT_SIZE;
if (ownAttributes['font-size']) {
// looks like the minimum should be 9px when dealing with ems. this is what looks like in browsers.
ownAttributes['font-size'] = fontSize = parseUnit(ownAttributes['font-size'], parentFontSize);
}

var normalizedAttr, normalizedValue, normalizedStyle = {};
for (var attr in ownAttributes) {
Expand Down Expand Up @@ -4457,7 +4461,7 @@ fabric.ElementsParser = function(elements, callback, options, reviver, parsingOp
var _options;
_this.resolveGradient(obj, 'fill');
_this.resolveGradient(obj, 'stroke');
if (obj instanceof fabric.Image) {
if (obj instanceof fabric.Image && obj._originalElement) {
_options = obj.parsePreserveAspectRatioAttribute(el);
}
obj._removeTransformMatrix(_options);
Expand Down Expand Up @@ -6923,6 +6927,7 @@ fabric.ElementsParser = function(elements, callback, options, reviver, parsingOp
* crossOrigin: 'anonymous'
* });
*/
// TODO: fix stretched examples
setBackgroundImage: function (image, callback, options) {
return this.__setBgOverlayImage('backgroundImage', image, callback, options);
},
Expand Down Expand Up @@ -7826,12 +7831,11 @@ fabric.ElementsParser = function(elements, callback, options, reviver, parsingOp

this._setSVGPreamble(markup, options);
this._setSVGHeader(markup, options);

this._setSVGBgOverlayColor(markup, 'backgroundColor');
this._setSVGBgOverlayImage(markup, 'backgroundImage', reviver);
if (this.clipPath) {
markup.push('<g clip-path="url(#' + this.clipPath.clipPathId + ')" >\n');
}
this._setSVGBgOverlayColor(markup, 'backgroundColor');
this._setSVGBgOverlayImage(markup, 'backgroundImage', reviver);
this._setSVGObjects(markup, reviver);
if (this.clipPath) {
markup.push('</g>\n');
Expand Down Expand Up @@ -9599,6 +9603,7 @@ fabric.PatternBrush = fabric.util.createClass(fabric.PencilBrush, /** @lends fab
},

renderTopLayer: function(ctx) {
ctx.save();
if (this.isDrawingMode && this._isCurrentlyDrawing) {
this.freeDrawingBrush && this.freeDrawingBrush._render();
this.contextTopDirty = true;
Expand All @@ -9608,6 +9613,7 @@ fabric.PatternBrush = fabric.util.createClass(fabric.PencilBrush, /** @lends fab
this._drawSelection(ctx);
this.contextTopDirty = true;
}
ctx.restore();
},

/**
Expand Down Expand Up @@ -18215,15 +18221,13 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
* of the instance
*/
_toSVG: function() {
var specificTransform = this._getOffsetTransform(),
path = this.path.map(function(path) {
return path.join(' ');
}).join(' ');
var path = this.path.map(function(path) {
return path.join(' ');
}).join(' ');
return [
'<path ', 'COMMON_PARTS',
'd="', path,
'" stroke-linecap="round" ',
'transform="' + specificTransform + '" ',
'/>\n'
];
},
Expand Down
2 changes: 1 addition & 1 deletion dist/fabric.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "fabric",
"description": "Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.",
"homepage": "http://fabricjs.com/",
"version": "2.4.4",
"version": "2.4.5",
"author": "Juriy Zaytsev <[email protected]>",
"contributors": [
{
Expand Down

0 comments on commit 8a15902

Please sign in to comment.