Comparing version 4.6.0 to 4.6.1
@@ -13,3 +13,3 @@ 'use strict'; | ||
*/ | ||
var VERSION = exports.VERSION = '4.6.0'; | ||
var VERSION = exports.VERSION = '4.6.1'; | ||
@@ -16,0 +16,0 @@ /** |
@@ -251,9 +251,9 @@ 'use strict'; | ||
filter.glShaders[renderer.CONTEXT_UID] = this.shaderCache[filter.glShaderKey] = shader; | ||
this.managedFilters.push(filter); | ||
} | ||
} else { | ||
shader = filter.glShaders[renderer.CONTEXT_UID] = new _Shader2.default(this.gl, filter.vertexSrc, filter.fragmentSrc); | ||
this.managedFilters.push(filter); | ||
} | ||
this.managedFilters.push(filter); | ||
// TODO - this only needs to be done once? | ||
@@ -260,0 +260,0 @@ renderer.bindVao(null); |
@@ -275,5 +275,14 @@ 'use strict'; | ||
for (i = 0; i < MAX_TEXTURES; ++i) { | ||
boundTextures[i] = rendererBoundTextures[i]; | ||
boundTextures[i]._virtalBoundId = i; | ||
var bt = rendererBoundTextures[i]; | ||
if (bt._enabled === TICK) { | ||
boundTextures[i] = this.renderer.emptyTextures[i]; | ||
continue; | ||
} | ||
boundTextures[i] = bt; | ||
bt._virtalBoundId = i; | ||
bt._enabled = TICK; | ||
} | ||
TICK++; | ||
@@ -280,0 +289,0 @@ for (i = 0; i < this.currentIndex; ++i) { |
@@ -107,2 +107,3 @@ 'use strict'; | ||
var result = ''; | ||
var firstChar = text.charAt(0); | ||
var lines = text.split('\n'); | ||
@@ -136,3 +137,3 @@ var wordWrapWidth = style.wordWrapWidth; | ||
} else { | ||
if (c === 0) { | ||
if (c === 0 && (j > 0 || firstChar === ' ')) { | ||
result += ' '; | ||
@@ -139,0 +140,0 @@ } |
@@ -85,3 +85,4 @@ 'use strict'; | ||
* @param {string} [style.lineJoin='miter'] - The lineJoin property sets the type of corner created, it can resolve | ||
* spiked text issues. Default is 'miter' (creates a sharp corner). | ||
* spiked text issues. Possible values "miter" (creates a sharp corner), "round" (creates a round corner) or "bevel" | ||
* (creates a squared corner). | ||
* @param {number} [style.miterLimit=10] - The miter limit to use when using the 'miter' lineJoin mode. This can reduce | ||
@@ -105,3 +106,5 @@ * or increase the spikiness of rendered text. | ||
Object.assign(this, defaultStyle, style); | ||
this.reset(); | ||
deepCopyProperties(this, style, style); | ||
} | ||
@@ -120,5 +123,3 @@ | ||
for (var key in defaultStyle) { | ||
clonedProperties[key] = this[key]; | ||
} | ||
deepCopyProperties(clonedProperties, this, defaultStyle); | ||
@@ -134,3 +135,3 @@ return new TextStyle(clonedProperties); | ||
TextStyle.prototype.reset = function reset() { | ||
Object.assign(this, defaultStyle); | ||
deepCopyProperties(this, defaultStyle, defaultStyle); | ||
}; | ||
@@ -787,2 +788,19 @@ | ||
} | ||
/** | ||
* Utility function to ensure that object properties are copied by value, and not by reference | ||
* | ||
* @param {Object} target Target object to copy properties into | ||
* @param {Object} source Source object for the proporties to copy | ||
* @param {string} propertyObj Object containing properties names we want to loop over | ||
*/ | ||
function deepCopyProperties(target, source, propertyObj) { | ||
for (var prop in propertyObj) { | ||
if (Array.isArray(source[prop])) { | ||
target[prop] = source[prop].slice(); | ||
} else { | ||
target[prop] = source[prop]; | ||
} | ||
} | ||
} | ||
//# sourceMappingURL=TextStyle.js.map |
@@ -735,3 +735,5 @@ 'use strict'; | ||
* Helper function that creates a base texture based on the source you provide. | ||
* The source can be - image url, image element, canvas element. | ||
* The source can be - image url, image element, canvas element. If the | ||
* source is an image url or an image element and not in the base texture | ||
* cache, it will be created and loaded. | ||
* | ||
@@ -738,0 +740,0 @@ * @static |
@@ -214,2 +214,6 @@ 'use strict'; | ||
delete this.source._pixiId; | ||
this.source.pause(); | ||
this.source.src = ''; | ||
this.source.load(); | ||
} | ||
@@ -216,0 +220,0 @@ |
@@ -42,5 +42,7 @@ 'use strict'; | ||
/** | ||
* | ||
* @param {number} [alpha=1] Amount of alpha from 0 to 1, where 0 is transparent | ||
*/ | ||
function AlphaFilter() { | ||
var alpha = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1.0; | ||
_classCallCheck(this, AlphaFilter); | ||
@@ -54,3 +56,3 @@ | ||
_this.alpha = 1.0; | ||
_this.alpha = alpha; | ||
_this.glShaderKey = 'alpha'; | ||
@@ -57,0 +59,0 @@ return _this; |
@@ -27,3 +27,3 @@ 'use strict'; | ||
* ```js | ||
* let colorMatrix = new PIXI.ColorMatrixFilter(); | ||
* let colorMatrix = new PIXI.filters.ColorMatrixFilter(); | ||
* container.filters = [colorMatrix]; | ||
@@ -30,0 +30,0 @@ * colorMatrix.contrast(2); |
@@ -230,8 +230,12 @@ 'use strict'; | ||
this.dynamicProperties = null; | ||
this.dynamicBuffer.destroy(); | ||
this.dynamicBuffer = null; | ||
this.dynamicData = null; | ||
this.dynamicBuffer.destroy(); | ||
this.dynamicDataUint32 = null; | ||
this.staticProperties = null; | ||
this.staticBuffer.destroy(); | ||
this.staticBuffer = null; | ||
this.staticData = null; | ||
this.staticBuffer.destroy(); | ||
this.staticDataUint32 = null; | ||
}; | ||
@@ -238,0 +242,0 @@ |
@@ -33,5 +33,5 @@ 'use strict'; | ||
// vertex shader | ||
['attribute vec2 aVertexPosition;', 'attribute vec2 aTextureCoord;', 'attribute vec4 aColor;', 'attribute vec2 aPositionCoord;', 'attribute vec2 aScale;', 'attribute float aRotation;', 'uniform mat3 projectionMatrix;', 'uniform vec4 uColor;', 'varying vec2 vTextureCoord;', 'varying vec4 vColor;', 'void main(void){', ' vec2 v = aVertexPosition;', ' v.x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);', ' v.y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);', ' v = v + aPositionCoord;', ' gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);', ' vTextureCoord = aTextureCoord;', ' vColor = aColor * uColor;', '}'].join('\n'), | ||
['attribute vec2 aVertexPosition;', 'attribute vec2 aTextureCoord;', 'attribute vec4 aColor;', 'attribute vec2 aPositionCoord;', 'attribute vec2 aScale;', 'attribute float aRotation;', 'uniform mat3 projectionMatrix;', 'uniform vec4 uColor;', 'varying vec2 vTextureCoord;', 'varying vec4 vColor;', 'void main(void){', ' float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);', ' float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);', ' vec2 v = vec2(x, y);', ' v = v + aPositionCoord;', ' gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);', ' vTextureCoord = aTextureCoord;', ' vColor = aColor * uColor;', '}'].join('\n'), | ||
// hello | ||
['varying vec2 vTextureCoord;', 'varying vec4 vColor;', 'uniform sampler2D uSampler;', 'void main(void){', ' vec4 color = texture2D(uSampler, vTextureCoord) * vColor;', ' if (color.a == 0.0) discard;', ' gl_FragColor = color;', '}'].join('\n'))); | ||
['varying vec2 vTextureCoord;', 'varying vec4 vColor;', 'uniform sampler2D uSampler;', 'void main(void){', ' vec4 color = texture2D(uSampler, vTextureCoord) * vColor;', ' gl_FragColor = color;', '}'].join('\n'))); | ||
} | ||
@@ -38,0 +38,0 @@ |
{ | ||
"name": "pixi.js", | ||
"version": "4.6.0", | ||
"version": "4.6.1", | ||
"description": "The HTML5 Creation Engine: Create beautiful digital content with the fastest, most flexible 2D WebGL renderer.", | ||
@@ -5,0 +5,0 @@ "author": "Mat Groves", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
7492858
59984
0