Commit bd515972 authored by Alexander.Trofimov's avatar Alexander.Trofimov

update cache by range

parent 966a072e
......@@ -4442,29 +4442,29 @@ function sparklineGroup() {
this.colorLow = null;
this.f = '??';
this.arrSparklines = [];
this.arrCachedSparklines = [];
this.arrCachedSparklines = [];
}
sparklineGroup.prototype.clearCached = function()
{
this.arrCachedSparklines.length = 0;
sparklineGroup.prototype.clearCached = function() {
this.arrCachedSparklines.length = 0;
};
sparklineGroup.prototype.addView = function(oSparklineView)
{
this.arrCachedSparklines.push(oSparklineView);
sparklineGroup.prototype.addView = function(oSparklineView) {
this.arrCachedSparklines.push(oSparklineView);
};
sparklineGroup.prototype.draw = function(oDrawingContext)
{
var graphics = new CGraphics();
graphics.init(oDrawingContext.ctx, oDrawingContext.getWidth(0), oDrawingContext.getHeight(0), oDrawingContext.getWidth(3), oDrawingContext.getHeight(3));
graphics.m_oFontManager = g_fontManager;
for(var i = 0; i < this.arrCachedSparklines.length; ++i)
{
this.arrCachedSparklines[i].draw(graphics);
}
sparklineGroup.prototype.draw = function(oDrawingContext) {
var graphics = new CGraphics();
graphics.init(oDrawingContext.ctx, oDrawingContext.getWidth(0), oDrawingContext.getHeight(0),
oDrawingContext.getWidth(3), oDrawingContext.getHeight(3));
graphics.m_oFontManager = g_fontManager;
for (var i = 0; i < this.arrCachedSparklines.length; ++i) {
this.arrCachedSparklines[i].draw(graphics);
}
};
sparklineGroup.prototype.updateCache = function(wsView)
{
wsView.objectRender.createSparklineViews(this);
sparklineGroup.prototype.updateCache = function(range) {
for (var i = 0; i < this.arrSparklines.length; ++i) {
if (range.intersectionSimple(this.arrSparklines[i].f)) {
this.arrCachedSparklines[i] = null;
}
}
};
/** @constructor */
function sparkline() {
......
......@@ -2003,7 +2003,10 @@ function DrawingObjects() {
_this.drawSparkLineGroups = function(oDrawingContext, oSparkLineGroups, range)
{
for(var i = 0; i < oSparkLineGroups.arrSparklineGroup.length; ++i) {
var oSparklineGroup = oSparkLineGroups.arrSparklineGroup[i];
oSparklineGroup.updateCache(range);
for(var j = 0; j < oSparklineGroup.arrSparklines.length; ++j) {
}
}
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment