MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / cssValueToPixels

Function cssValueToPixels

MathBox/dat.gui.js:329–343  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

327 var CSS_VALUE_PIXELS = /(\d+(\.\d+)?)px/;
328
329 function cssValueToPixels(val) {
330
331 if (val === '0' || common.isUndefined(val)) return 0;
332
333 var match = val.match(CSS_VALUE_PIXELS);
334
335 if (!common.isNull(match)) {
336 return parseFloat(match[1]);
337 }
338
339 // TODO ...ems? %?
340
341 return 0;
342
343 }
344
345 /**
346 * @namespace

Callers 1

dat.gui.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected