Sfoglia il codice sorgente

Update CSS3DRenderer.js

feat(size): adds method to return the renderers size
Patrick 10 anni fa
parent
commit
3c2db27041
1 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 9 0
      examples/js/renderers/CSS3DRenderer.js

+ 9 - 0
examples/js/renderers/CSS3DRenderer.js

@@ -88,6 +88,15 @@ THREE.CSS3DRenderer = function () {
 		cameraElement.style.height = height + 'px';
 		cameraElement.style.height = height + 'px';
 
 
 	};
 	};
+	
+	/**
+	 * Returns the renderers pixel size as descriptive object
+	 * 
+	 * @returns {Object} The size object with keys 'width' and 'height'
+	 */
+	this.getSize = function() {
+		return {width: _width, height: _height};
+	};
 
 
 	var epsilon = function ( value ) {
 	var epsilon = function ( value ) {