Comparing version 1.1.4 to 1.1.5
@@ -25,3 +25,5 @@ /** @module gl-util/context */ | ||
depth: opts.depth != null ? opts.depth : false, | ||
stencil: opts.stencil != null ? opts.stencil : false | ||
stencil: opts.stencil != null ? opts.stencil : false, | ||
width: opts.width, | ||
height: opts.height | ||
}); | ||
@@ -28,0 +30,0 @@ |
{ | ||
"name": "gl-util", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "Set of practical webgl utils", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -56,3 +56,5 @@ 'use strict' | ||
if (info.type === gl.SAMPLER_2D || info.type === gl.SAMPLER_CUBE) { | ||
textures[info.name] = {name: info.name} | ||
if (!textures[info.name]) { | ||
textures[info.name] = {name: info.name} | ||
} | ||
} | ||
@@ -75,3 +77,5 @@ } | ||
//if no options passed - just return known texture info | ||
if (options == null) return texture; | ||
if (options == null) { | ||
return texture; | ||
} | ||
@@ -162,5 +166,5 @@ if (!isPlainObject(options)) options = {data: options}; | ||
let len = data && data.length || 1; | ||
if (options.width) texture.width = options.width; | ||
if (options.width != null) texture.width = options.width; | ||
else if (texture.width == null) texture.width = data && data.width || (texture.format === gl.ALPHA ? len : Math.max(len / 4, 1)); | ||
if (options.height) texture.height = options.height; | ||
if (options.height != null) texture.height = options.height; | ||
else if (texture.height == null) texture.height = (data && data.height) || 1; | ||
@@ -167,0 +171,0 @@ } |
87433
634