Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions dist/fpsmeter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* FPSMeter 0.3.1 - 9th May 2013
* https://github.com/Darsain/fpsmeter
* fpsmeter 0.3.1 - 2nd Oct 2017
* https://github.com/darsain/fpsmeter
*
* Licensed under the MIT license.
* http://opensource.org/licenses/MIT
Expand Down Expand Up @@ -47,11 +47,11 @@
if (value == null) {
return String(value);
}

if (typeof value === 'object' || typeof value === 'function') {
return Object.prototype.toString.call(value).match(/\s([a-z]+)/i)[1].toLowerCase() || 'object';
return (value instanceof w.NodeList && 'nodelist') ||
(value instanceof w.HTMLCollection && 'htmlcollection') ||
Object.prototype.toString.call(value).match(/\s([a-z]+)/i)[1].toLowerCase();
}

return typeof value;
}

Expand Down Expand Up @@ -92,7 +92,11 @@
if (args[1].hasOwnProperty(key)) {
switch (type(args[1][key])) {
case 'object':
args[0][key] = extend({}, args[0][key], args[1][key]);
if (type(args[0][key]) === 'object') {
extend(args[0][key], args[1][key]);
} else {
args[0][key] = extend({}, args[1][key]);
}
break;

case 'array':
Expand Down Expand Up @@ -441,7 +445,7 @@
// Update legend only when changed
if (el.legend.fps !== showFps) {
el.legend.fps = showFps;
el.legend[textProp] = showFps ? 'FPS' : 'ms';
el.legend[textProp] = showFps ? o.labelFps : o.labelMs;
}
// Update counter with a nicely formated & readable number
count = showFps ? self.fps : self.duration;
Expand Down Expand Up @@ -692,8 +696,11 @@
heat: 0, // Allow themes to use coloring by FPS heat. 0 FPS = red, maxFps = green.

// Graph
graph: 0, // Whether to show history graph.
history: 20 // How many history states to show in a graph.
graph: 0, // Whether to show history graph.
history: 20, // How many history states to show in a graph.

labelFps: 'FPS', // The label to present when showing FPS.s
labelMs: 'ms' // The label to present when showing MSs.
};

// Option names that trigger FPSMeter rebuild or reposition when modified
Expand Down
31 changes: 16 additions & 15 deletions dist/fpsmeter.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions src/fpsmeter.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@
// Update legend only when changed
if (el.legend.fps !== showFps) {
el.legend.fps = showFps;
el.legend[textProp] = showFps ? 'FPS' : 'ms';
el.legend[textProp] = showFps ? o.labelFps : o.labelMs;
}
// Update counter with a nicely formated & readable number
count = showFps ? self.fps : self.duration;
Expand Down Expand Up @@ -689,8 +689,11 @@
heat: 0, // Allow themes to use coloring by FPS heat. 0 FPS = red, maxFps = green.

// Graph
graph: 0, // Whether to show history graph.
history: 20 // How many history states to show in a graph.
graph: 0, // Whether to show history graph.
history: 20, // How many history states to show in a graph.

labelFps: 'FPS', // The label to present when showing FPS.
labelMs: 'ms' // The label to present when showing MSs.
};

// Option names that trigger FPSMeter rebuild or reposition when modified
Expand All @@ -710,4 +713,4 @@
'bottom',
'margin'
];
}(window));
}(window));