mirror of
https://github.com/overte-org/overte.git
synced 2025-04-15 12:28:51 +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;
|
||||
|
||||
function decimalMegabytes(number) {
|
||||
if (number) {
|
||||
return (number / BYTES_PER_MEGABYTE).toFixed(1);
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
return number ? (number / BYTES_PER_MEGABYTE).toFixed(1) : "";
|
||||
}
|
||||
|
||||
function displayIfNonZero(number) {
|
||||
return number ? number : "";
|
||||
}
|
||||
|
||||
function addEntity(id, name, type, url, locked, visible, verticesCount, texturesCount, texturesSize, hasTransparent,
|
||||
|
@ -150,9 +150,10 @@ function loaded() {
|
|||
|
||||
if (entities[id] === undefined) {
|
||||
entityList.add([{
|
||||
id: id, name: name, type: type, url: filename, locked: locked, visible: visible, verticesCount: verticesCount,
|
||||
texturesCount: texturesCount, texturesSize: decimalMegabytes(texturesSize), hasTransparent: hasTransparent,
|
||||
drawCalls: drawCalls, hasScript: hasScript
|
||||
id: id, name: name, type: type, url: filename, locked: locked, visible: visible,
|
||||
verticesCount: displayIfNonZero(verticesCount), texturesCount: displayIfNonZero(texturesCount),
|
||||
texturesSize: decimalMegabytes(texturesSize), hasTransparent: hasTransparent,
|
||||
drawCalls: displayIfNonZero(drawCalls), hasScript: hasScript
|
||||
}],
|
||||
function (items) {
|
||||
var currentElement = items[0].elm;
|
||||
|
|
Loading…
Reference in a new issue