fabric 5.2.4-browser → 5.3.0-browser
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "fabric",
|
|
3
3
|
"description": "Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.",
|
|
4
4
|
"homepage": "http://fabricjs.com/",
|
|
5
|
-
"version": "5.
|
|
5
|
+
"version": "5.3.0-browser",
|
|
6
6
|
"author": "Juriy Zaytsev <kangax@gmail.com>",
|
|
7
7
|
"contributors": [
|
|
8
8
|
{
|
|
@@ -251,13 +251,14 @@
|
|
|
251
251
|
* @param {Number} width The width to initialize the texture at.
|
|
252
252
|
* @param {Number} height The height to initialize the texture.
|
|
253
253
|
* @param {HTMLImageElement|HTMLCanvasElement} textureImageSource A source for the texture data.
|
|
254
|
+
* @param {Number} filterType gl.NEAREST or gl.LINEAR usually, webgl numeri constants
|
|
254
255
|
* @returns {WebGLTexture}
|
|
255
256
|
*/
|
|
256
|
-
createTexture: function(gl, width, height, textureImageSource) {
|
|
257
|
+
createTexture: function(gl, width, height, textureImageSource, filterType) {
|
|
257
258
|
var texture = gl.createTexture();
|
|
258
259
|
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
259
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
|
|
260
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
|
|
260
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, filterType || gl.NEAREST);
|
|
261
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, filterType || gl.NEAREST);
|
|
261
262
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
262
263
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
263
264
|
if (textureImageSource) {
|
|
@@ -16,7 +16,7 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
|
|
|
16
16
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=870966
|
|
17
17
|
this.hiddenTextarea.style.cssText = 'position: absolute; top: ' + style.top +
|
|
18
18
|
'; left: ' + style.left + '; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px;' +
|
|
19
|
-
' padding
|
|
19
|
+
' padding-top: ' + style.fontSize + ';';
|
|
20
20
|
|
|
21
21
|
if (this.hiddenTextareaContainer) {
|
|
22
22
|
this.hiddenTextareaContainer.appendChild(this.hiddenTextarea);
|
package/src/util/misc.js
CHANGED
|
@@ -1235,6 +1235,7 @@
|
|
|
1235
1235
|
prevStyle.fontFamily !== thisStyle.fontFamily ||
|
|
1236
1236
|
prevStyle.fontWeight !== thisStyle.fontWeight ||
|
|
1237
1237
|
prevStyle.fontStyle !== thisStyle.fontStyle ||
|
|
1238
|
+
prevStyle.textBackgroundColor !== thisStyle.textBackgroundColor ||
|
|
1238
1239
|
prevStyle.deltaY !== thisStyle.deltaY) ||
|
|
1239
1240
|
(forTextSpans &&
|
|
1240
1241
|
(prevStyle.overline !== thisStyle.overline ||
|
|
@@ -1268,7 +1269,7 @@
|
|
|
1268
1269
|
charIndex++;
|
|
1269
1270
|
var thisStyle = styles[i][c];
|
|
1270
1271
|
//check if style exists for this character
|
|
1271
|
-
if (thisStyle) {
|
|
1272
|
+
if (thisStyle && Object.keys(thisStyle).length > 0) {
|
|
1272
1273
|
var styleChanged = fabric.util.hasStyleChanged(prevStyle, thisStyle, true);
|
|
1273
1274
|
if (styleChanged) {
|
|
1274
1275
|
stylesArray.push({
|