Skip to content

Commit

Permalink
Possible fix for gifs as portal thumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaicoianu committed Feb 27, 2017
1 parent 7460be5 commit e808981
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/portal.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,16 @@ elation.require(['janusweb.janusbase'], function() {
}
this.createMaterial = function() {
var matargs = { color: 0xdddddd };
var mat;
var mat = new THREE.MeshBasicMaterial(matargs);
if (this.thumb_id) {
var asset = this.getAsset('image', this.thumb_id);
if (asset) var thumb = asset.getInstance();
if (thumb) {
matargs.map = thumb;
mat.map = thumb;
if (asset.loaded) {
if (asset.hasalpha) {
matargs.transparent = true;
matargs.alphaTest = 0.1;
mat.transparent = true;
mat.alphaTest = 0.1;
}
} else {
elation.events.add(thumb, 'asset_load', function() {
Expand All @@ -145,9 +145,9 @@ elation.require(['janusweb.janusbase'], function() {
}
});
}
elation.events.add(thumb, 'asset_update', elation.bind(this, function(ev) { mat.map = ev.data; }));
}
}
mat = new THREE.MeshBasicMaterial(matargs);
return mat;
}
this.updateMaterial = function() {
Expand Down

0 comments on commit e808981

Please sign in to comment.