offline-editor-js/lib/edit/OfflineUtils.js
2014-01-22 00:19:45 +01:00

20 lines
556 B
JavaScript

"use strict"
define(["edit/editsStore"],function(editsStore)
{
return function OfflineUtils()
{
/**
* Measures the size of the graphic's geometry and attributes.
* This is a very fast method that only provides a basic estimation.
* @param graphic
* @returns {number}
*/
// jabadia: probably won't be needed
this.apprxGraphicSize = function(graphic) {
var g = editsStore._serialize(graphic);
return ((g.length *2)/1024/1024).round(4);
}
}
});