src/js/StaticCanvas.js
function prepareNodes(mindmap) {
    // clone tree since we modify it
    var root = mindmap.getRoot().clone();

    function addProps(node) {
      var lineWidth = mindmaps.CanvasDrawingUtil.getLineWidth(zoomFactor,
          node.getDepth());
      var metrics = mindmaps.TextMetrics.getTextMetrics(node, zoomFactor);

      var props = {
        lineWidth : lineWidth,
        textMetrics : metrics,
        width : function() {
          if (node.isRoot()) {
            return 0;
          }
          return metrics.width;
        },
        innerHeight : function() {
          return metrics.height + padding;
        },

        outerHeight : function() {
          return metrics.height + lineWidth + padding;
        }
      };

      $.extend(node, props);

      node.forEachChild(function(child) {
        addProps(child);
      });
    }

    addProps(root);

    return root;
  }
function prepareNodes(mindmap) {
    // clone tree since we modify it
    var root = mindmap.getRoot().clone();

    function addProps(node) {
      var lineWidth = mindmaps.CanvasDrawingUtil.getLineWidth(zoomFactor,
          node.getDepth());
      var metrics = mindmaps.TextMetrics.getTextMetrics(node, zoomFactor);

      var props = {
        lineWidth : lineWidth,
        textMetrics : metrics,
        width : function() {
          if (node.isRoot()) {
            return 0;
          }
          return metrics.width;
        },
        innerHeight : function() {
          return metrics.height + padding;
        },

        outerHeight : function() {
          return metrics.height + lineWidth + padding;
        }
      };

      $.extend(node, props);

      node.forEachChild(function(child) {
        addProps(child);
      });
    }

    addProps(root);

    return root;
  }
function prepareNodes ( mindmap ) { // clone tree since we modify it var root = mindmap . getRoot ( ) . clone ( ) ; function addProps ( node ) { var lineWidth = mindmaps . CanvasDrawingUtil . getLineWidth ( zoomFactor , node . getDepth ( ) ) ; var metrics = mindmaps . TextMetrics . getTextMetrics ( node , zoomFactor ) ; var props = { lineWidth : lineWidth , textMetrics : metrics , width : function ( ) { if ( node . isRoot ( ) ) { return 0 ; } return metrics . width ; } , innerHeight : function ( ) { return metrics . height + padding ; } , outerHeight : function ( ) { return metrics . height + lineWidth + padding ; } } ; $ . extend ( node , props ) ; node . forEachChild ( function ( child ) { addProps ( child ) ; } ) ; } addProps ( root ) ; return root ; }
Adds some information to each node which are needed for rendering.

@param mindmap
@returns
Adds some information to each node which are needed for rendering .