-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: janusweb action: commit revision: path_from: revision_from: 0b2fdbde451526c65ca7944d4b279f7476d8083b: path_to: revision_to:
commit 0b2fdbde451526c65ca7944d4b279f7476d8083b Author: James Baicoianu <james_github@baicoianu.com> Date: Mon Mar 13 02:22:01 2017 -0700 Fixed image aspect ratio handling to be consistent with native diff --git a/scripts/image.js b/scripts/image.js
--- a/scripts/image.js +++ b/scripts/image.js @@ -64,9 +64,18 @@ elation.require(['janusweb.janusbase'], function() { } this.createGeometry = function() { var aspect = this.getAspect(), - thickness = .1; - var box = new THREE.BoxGeometry(2, 2 * aspect, thickness); - box.applyMatrix(new THREE.Matrix4().makeTranslation(0, 0, .1 / this.properties.scale.z)); + thickness = Math.max(this.scale.x, this.scale.z) / 10; + var box = new THREE.BoxBufferGeometry(2, 2 * aspect, thickness); + box.applyMatrix(new THREE.Matrix4().makeTranslation(0, 0, thickness/2)); + + // Flip the back face for images + var uvs = box.attributes.uv; + var start = 20, + count = 4; + for (var i = start; i < start + count; i++) { + uvs.array[i*2] = 1.0 - uvs.array[i*2]; + } + return box; } this.createMaterial = function() { @@ -139,8 +148,8 @@ elation.require(['janusweb.janusbase'], function() { } this.getAspect = function() { var aspect = 1; - if (this.texture && this.texture.image) { - var size = this.getSize(this.texture.image); + if (this.asset && this.asset.rawimage) { + var size = this.getSize(this.asset.rawimage); aspect = size.height / size.width; } if (this.sbs3d || (this.asset && this.asset.sbs3d)) aspect *= 2;
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 14:58:15 2024