mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-03-16 22:10:32 +00:00
v171 (#3478)
This commit is contained in:
parent
8a6b17cac6
commit
75e5a78431
7 changed files with 64 additions and 40 deletions
11
CHANGELOG.md
11
CHANGELOG.md
|
|
@ -1,4 +1,12 @@
|
|||
**Version 1.7.0**
|
||||
**Version 1.7.1**
|
||||
|
||||
- Add: Gradients/Patterns support customAttributes in toObject method [#3477](https://github.com/kangax/fabric.js/pull/3477)
|
||||
- Fix: IText/Textbox not blurring keyboard on ios 10 [#3476](https://github.com/kangax/fabric.js/pull/3476)
|
||||
- Fix: Shadow on freedrawing and zoomed canvas [#3475](https://github.com/kangax/fabric.js/pull/3475)
|
||||
- Fix: Fix for group returning negative scales [#3474](https://github.com/kangax/fabric.js/pull/3474)
|
||||
- Fix: hotfix for textbox [#3441](https://github.com/kangax/fabric.js/pull/3441)[#3473](https://github.com/kangax/fabric.js/pull/3473)
|
||||
|
||||
**Version 1.7.0**
|
||||
|
||||
- Add: Object Caching [#3417](https://github.com/kangax/fabric.js/pull/3417)
|
||||
- Improvement: group internal objects have coords not affected by canvas zoom [#3420](https://github.com/kangax/fabric.js/pull/3420)
|
||||
|
|
@ -45,7 +53,6 @@
|
|||
- Fix: Error in dataURL with multiplier was outputting very big canvas with retina [#3314](https://github.com/kangax/fabric.js/pull/3314)
|
||||
- Fix: Error in style map was not respecting style if textbox started with space [#3315](https://github.com/kangax/fabric.js/pull/3315)
|
||||
|
||||
|
||||
**Version 1.6.4**
|
||||
|
||||
- Improvement: Ignore svg: namespace during svg import. [#3081](https://github.com/kangax/fabric.js/pull/3081)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */
|
||||
|
||||
var fabric = fabric || { version: "1.7.0" };
|
||||
var fabric = fabric || { version: "1.7.1" };
|
||||
if (typeof exports !== 'undefined') {
|
||||
exports.fabric = fabric;
|
||||
}
|
||||
|
|
|
|||
39
dist/fabric.js
vendored
39
dist/fabric.js
vendored
|
|
@ -1,7 +1,7 @@
|
|||
/* build: `node build.js modules=ALL exclude=json,gestures minifier=uglifyjs` */
|
||||
/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */
|
||||
|
||||
var fabric = fabric || { version: "1.7.0" };
|
||||
var fabric = fabric || { version: "1.7.1" };
|
||||
if (typeof exports !== 'undefined') {
|
||||
exports.fabric = fabric;
|
||||
}
|
||||
|
|
@ -5362,10 +5362,11 @@ fabric.ElementsParser.prototype.checkIfDone = function() {
|
|||
|
||||
/**
|
||||
* Returns object representation of a gradient
|
||||
* @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output
|
||||
* @return {Object}
|
||||
*/
|
||||
toObject: function() {
|
||||
return {
|
||||
toObject: function(propertiesToInclude) {
|
||||
var object = {
|
||||
type: this.type,
|
||||
coords: this.coords,
|
||||
colorStops: this.colorStops,
|
||||
|
|
@ -5373,6 +5374,9 @@ fabric.ElementsParser.prototype.checkIfDone = function() {
|
|||
offsetY: this.offsetY,
|
||||
gradientTransform: this.gradientTransform ? this.gradientTransform.concat() : this.gradientTransform
|
||||
};
|
||||
fabric.util.populateWithProperties(this, object, propertiesToInclude);
|
||||
|
||||
return object;
|
||||
},
|
||||
|
||||
/* _TO_SVG_START_ */
|
||||
|
|
@ -5719,11 +5723,12 @@ fabric.Pattern = fabric.util.createClass(/** @lends fabric.Pattern.prototype */
|
|||
|
||||
/**
|
||||
* Returns object representation of a pattern
|
||||
* @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output
|
||||
* @return {Object} Object representation of a pattern instance
|
||||
*/
|
||||
toObject: function() {
|
||||
toObject: function(propertiesToInclude) {
|
||||
|
||||
var source;
|
||||
var source, object;
|
||||
|
||||
// callback
|
||||
if (typeof this.source === 'function') {
|
||||
|
|
@ -5738,12 +5743,15 @@ fabric.Pattern = fabric.util.createClass(/** @lends fabric.Pattern.prototype */
|
|||
source = this.source.toDataURL();
|
||||
}
|
||||
|
||||
return {
|
||||
object = {
|
||||
source: source,
|
||||
repeat: this.repeat,
|
||||
offsetX: this.offsetX,
|
||||
offsetY: this.offsetY
|
||||
};
|
||||
fabric.util.populateWithProperties(this, object, propertiesToInclude);
|
||||
|
||||
return object;
|
||||
},
|
||||
|
||||
/* _TO_SVG_START_ */
|
||||
|
|
@ -7687,12 +7695,13 @@ fabric.BaseBrush = fabric.util.createClass(/** @lends fabric.BaseBrush.prototype
|
|||
return;
|
||||
}
|
||||
|
||||
var ctx = this.canvas.contextTop;
|
||||
var ctx = this.canvas.contextTop,
|
||||
zoom = this.canvas.getZoom();
|
||||
|
||||
ctx.shadowColor = this.shadow.color;
|
||||
ctx.shadowBlur = this.shadow.blur;
|
||||
ctx.shadowOffsetX = this.shadow.offsetX;
|
||||
ctx.shadowOffsetY = this.shadow.offsetY;
|
||||
ctx.shadowBlur = this.shadow.blur * zoom;
|
||||
ctx.shadowOffsetX = this.shadow.offsetX * zoom;
|
||||
ctx.shadowOffsetY = this.shadow.offsetY * zoom;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -18095,13 +18104,13 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
|
|||
var matrix = object.calcTransformMatrix(),
|
||||
options = fabric.util.qrDecompose(matrix),
|
||||
center = new fabric.Point(options.translateX, options.translateY);
|
||||
object.scaleX = options.scaleX;
|
||||
object.scaleY = options.scaleY;
|
||||
object.flipX = false;
|
||||
object.flipY = false;
|
||||
object.set('scaleX', options.scaleX);
|
||||
object.set('scaleY', options.scaleY);
|
||||
object.skewX = options.skewX;
|
||||
object.skewY = options.skewY;
|
||||
object.angle = options.angle;
|
||||
object.flipX = false;
|
||||
object.flipY = false;
|
||||
object.setPositionByOrigin(center, 'center', 'center');
|
||||
return object;
|
||||
},
|
||||
|
|
@ -24117,6 +24126,7 @@ fabric.Image.filters.BaseFilter = fabric.util.createClass(/** @lends fabric.Imag
|
|||
this.selectable = true;
|
||||
|
||||
this.selectionEnd = this.selectionStart;
|
||||
this.hiddenTextarea.blur && this.hiddenTextarea.blur();
|
||||
this.hiddenTextarea && this.canvas && this.hiddenTextarea.parentNode.removeChild(this.hiddenTextarea);
|
||||
this.hiddenTextarea = null;
|
||||
|
||||
|
|
@ -25785,6 +25795,7 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
|
|||
* @override
|
||||
*/
|
||||
_splitTextIntoLines: function(ctx) {
|
||||
ctx = ctx || this.ctx;
|
||||
var originalAlign = this.textAlign;
|
||||
ctx.save();
|
||||
this._setTextStyles(ctx);
|
||||
|
|
|
|||
16
dist/fabric.min.js
vendored
16
dist/fabric.min.js
vendored
File diff suppressed because one or more lines are too long
BIN
dist/fabric.min.js.gz
vendored
BIN
dist/fabric.min.js.gz
vendored
Binary file not shown.
34
dist/fabric.require.js
vendored
34
dist/fabric.require.js
vendored
|
|
@ -1,5 +1,5 @@
|
|||
var fabric = fabric || {
|
||||
version: "1.7.0"
|
||||
version: "1.7.1"
|
||||
};
|
||||
|
||||
if (typeof exports !== "undefined") {
|
||||
|
|
@ -2872,8 +2872,8 @@ fabric.ElementsParser.prototype.checkIfDone = function() {
|
|||
}
|
||||
return this;
|
||||
},
|
||||
toObject: function() {
|
||||
return {
|
||||
toObject: function(propertiesToInclude) {
|
||||
var object = {
|
||||
type: this.type,
|
||||
coords: this.coords,
|
||||
colorStops: this.colorStops,
|
||||
|
|
@ -2881,6 +2881,8 @@ fabric.ElementsParser.prototype.checkIfDone = function() {
|
|||
offsetY: this.offsetY,
|
||||
gradientTransform: this.gradientTransform ? this.gradientTransform.concat() : this.gradientTransform
|
||||
};
|
||||
fabric.util.populateWithProperties(this, object, propertiesToInclude);
|
||||
return object;
|
||||
},
|
||||
toSVG: function(object) {
|
||||
var coords = fabric.util.object.clone(this.coords), markup, commonAttributes;
|
||||
|
|
@ -3044,8 +3046,8 @@ fabric.Pattern = fabric.util.createClass({
|
|||
this.offsetY = options.offsetY;
|
||||
}
|
||||
},
|
||||
toObject: function() {
|
||||
var source;
|
||||
toObject: function(propertiesToInclude) {
|
||||
var source, object;
|
||||
if (typeof this.source === "function") {
|
||||
source = String(this.source);
|
||||
} else if (typeof this.source.src === "string") {
|
||||
|
|
@ -3053,12 +3055,14 @@ fabric.Pattern = fabric.util.createClass({
|
|||
} else if (typeof this.source === "object" && this.source.toDataURL) {
|
||||
source = this.source.toDataURL();
|
||||
}
|
||||
return {
|
||||
object = {
|
||||
source: source,
|
||||
repeat: this.repeat,
|
||||
offsetX: this.offsetX,
|
||||
offsetY: this.offsetY
|
||||
};
|
||||
fabric.util.populateWithProperties(this, object, propertiesToInclude);
|
||||
return object;
|
||||
},
|
||||
toSVG: function(object) {
|
||||
var patternSource = typeof this.source === "function" ? this.source() : this.source, patternWidth = patternSource.width / object.getWidth(), patternHeight = patternSource.height / object.getHeight(), patternOffsetX = this.offsetX / object.getWidth(), patternOffsetY = this.offsetY / object.getHeight(), patternImgSrc = "";
|
||||
|
|
@ -3863,11 +3867,11 @@ fabric.BaseBrush = fabric.util.createClass({
|
|||
if (!this.shadow) {
|
||||
return;
|
||||
}
|
||||
var ctx = this.canvas.contextTop;
|
||||
var ctx = this.canvas.contextTop, zoom = this.canvas.getZoom();
|
||||
ctx.shadowColor = this.shadow.color;
|
||||
ctx.shadowBlur = this.shadow.blur;
|
||||
ctx.shadowOffsetX = this.shadow.offsetX;
|
||||
ctx.shadowOffsetY = this.shadow.offsetY;
|
||||
ctx.shadowBlur = this.shadow.blur * zoom;
|
||||
ctx.shadowOffsetX = this.shadow.offsetX * zoom;
|
||||
ctx.shadowOffsetY = this.shadow.offsetY * zoom;
|
||||
},
|
||||
_resetShadow: function() {
|
||||
var ctx = this.canvas.contextTop;
|
||||
|
|
@ -8706,13 +8710,13 @@ fabric.util.object.extend(fabric.Object.prototype, {
|
|||
},
|
||||
realizeTransform: function(object) {
|
||||
var matrix = object.calcTransformMatrix(), options = fabric.util.qrDecompose(matrix), center = new fabric.Point(options.translateX, options.translateY);
|
||||
object.scaleX = options.scaleX;
|
||||
object.scaleY = options.scaleY;
|
||||
object.flipX = false;
|
||||
object.flipY = false;
|
||||
object.set("scaleX", options.scaleX);
|
||||
object.set("scaleY", options.scaleY);
|
||||
object.skewX = options.skewX;
|
||||
object.skewY = options.skewY;
|
||||
object.angle = options.angle;
|
||||
object.flipX = false;
|
||||
object.flipY = false;
|
||||
object.setPositionByOrigin(center, "center", "center");
|
||||
return object;
|
||||
},
|
||||
|
|
@ -11400,6 +11404,7 @@ fabric.Image.filters.BaseFilter = fabric.util.createClass({
|
|||
this.isEditing = false;
|
||||
this.selectable = true;
|
||||
this.selectionEnd = this.selectionStart;
|
||||
this.hiddenTextarea.blur && this.hiddenTextarea.blur();
|
||||
this.hiddenTextarea && this.canvas && this.hiddenTextarea.parentNode.removeChild(this.hiddenTextarea);
|
||||
this.hiddenTextarea = null;
|
||||
this.abortCursorAnimation();
|
||||
|
|
@ -12299,6 +12304,7 @@ fabric.util.object.extend(fabric.IText.prototype, {
|
|||
return lines;
|
||||
},
|
||||
_splitTextIntoLines: function(ctx) {
|
||||
ctx = ctx || this.ctx;
|
||||
var originalAlign = this.textAlign;
|
||||
ctx.save();
|
||||
this._setTextStyles(ctx);
|
||||
|
|
|
|||
|
|
@ -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": "1.7.0",
|
||||
"version": "1.7.1",
|
||||
"author": "Juriy Zaytsev <kangax@gmail.com>",
|
||||
"contributors": [
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue