Class mindmaps.DefaultCanvasView-TextMetrics
Defined in: CanvasView.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| <inner> |
Utitility object that calculates how much space a text would take up in a
node.
|
| Method Attributes | Method Name and Description |
|---|---|
|
getTextMetrics(node, text)
Calculates the width and height a node would have to provide to show
the text.
|
Class Detail
<inner>
mindmaps.DefaultCanvasView-TextMetrics(view)
Utitility object that calculates how much space a text would take up in a
node. This is done through a dummy div that has the same formatting as
the node and gets the text injected.
- Parameters:
- {mindmaps.CanvasView} view
Method Detail
{Object}
getTextMetrics(node, text)
Calculates the width and height a node would have to provide to show
the text.
- Parameters:
- {mindmaps.Node} node
- the node whose text is to be measured.
- {mindmaps.Node} text Optional
- use this instead of the text of node
- Returns:
- {Object} object with properties width and height.