mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 14:18:24 +02:00
Display render info values only when valid provided
This commit is contained in:
parent
0cf3f6e953
commit
fa0aeb4563
1 changed files with 9 additions and 8 deletions
|
@ -135,11 +135,11 @@ function loaded() {
|
||||||
const BYTES_PER_MEGABYTE = 1024 * 1024;
|
const BYTES_PER_MEGABYTE = 1024 * 1024;
|
||||||
|
|
||||||
function decimalMegabytes(number) {
|
function decimalMegabytes(number) {
|
||||||
if (number) {
|
return number ? (number / BYTES_PER_MEGABYTE).toFixed(1) : "";
|
||||||
return (number / BYTES_PER_MEGABYTE).toFixed(1);
|
}
|
||||||
} else {
|
|
||||||
return "";
|
function displayIfNonZero(number) {
|
||||||
}
|
return number ? number : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
function addEntity(id, name, type, url, locked, visible, verticesCount, texturesCount, texturesSize, hasTransparent,
|
function addEntity(id, name, type, url, locked, visible, verticesCount, texturesCount, texturesSize, hasTransparent,
|
||||||
|
@ -150,9 +150,10 @@ function loaded() {
|
||||||
|
|
||||||
if (entities[id] === undefined) {
|
if (entities[id] === undefined) {
|
||||||
entityList.add([{
|
entityList.add([{
|
||||||
id: id, name: name, type: type, url: filename, locked: locked, visible: visible, verticesCount: verticesCount,
|
id: id, name: name, type: type, url: filename, locked: locked, visible: visible,
|
||||||
texturesCount: texturesCount, texturesSize: decimalMegabytes(texturesSize), hasTransparent: hasTransparent,
|
verticesCount: displayIfNonZero(verticesCount), texturesCount: displayIfNonZero(texturesCount),
|
||||||
drawCalls: drawCalls, hasScript: hasScript
|
texturesSize: decimalMegabytes(texturesSize), hasTransparent: hasTransparent,
|
||||||
|
drawCalls: displayIfNonZero(drawCalls), hasScript: hasScript
|
||||||
}],
|
}],
|
||||||
function (items) {
|
function (items) {
|
||||||
var currentElement = items[0].elm;
|
var currentElement = items[0].elm;
|
||||||
|
|
Loading…
Reference in a new issue