only update text layer if the document changes

This commit is contained in:
Fabian Jakobs 2010-04-08 13:16:03 +02:00
commit 8135c9a612
4 changed files with 65 additions and 36 deletions

View file

@ -42,6 +42,23 @@ TextLayer.prototype._measureSizes = function()
this.element.removeChild(measureNode);
};
TextLayer.prototype.updateLines = function(layerConfig, firstRow, lastRow)
{
var first = Math.max(firstRow, layerConfig.firstRow);
var last = Math.min(lastRow, layerConfig.lastRow);
var lineElements = this.element.childNodes;
for (var i=first; i <= last; i++)
{
var html = [];
this.renderLine(html, i);
var lineElement = lineElements[i-layerConfig.firstRow];
lineElement.innerHTML = html.join("");
};
};
TextLayer.prototype.update = function(config)
{
var html = [];