MCPcopy
hub / github.com/soulwire/fit.js / toRectangle

Function toRectangle

fit.js:231–254  ·  view source on GitHub ↗
( target )

Source from the content-addressed store, hash-verified

229 */
230
231 function toRectangle( target ) {
232
233 if ( target.nodeType && target.nodeType == 1 ) {
234
235 var bounds = target.getBoundingClientRect();
236
237 target = {
238 height: target.offsetHeight,
239 width: target.offsetWidth,
240 x: bounds.left,
241 y: bounds.top
242 };
243 }
244
245 if ( !isNumber( target.x ) && isNumber( target.left ) )
246
247 target.x = target.left;
248
249 if ( !isNumber( target.y ) && isNumber( target.top ) )
250
251 target.y = target.top;
252
253 return target;
254 }
255
256 /*
257 ————————————————————————————————————————————————————————————————————————————————

Callers 1

fitFunction · 0.85

Calls 1

isNumberFunction · 0.85

Tested by

no test coverage detected