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

update cache by range

parent e67cfbad
...@@ -4466,29 +4466,29 @@ function sparklineGroup() { ...@@ -4466,29 +4466,29 @@ function sparklineGroup() {
this.colorLow = null; this.colorLow = null;
this.f = '??'; this.f = '??';
this.arrSparklines = []; this.arrSparklines = [];
this.arrCachedSparklines = []; this.arrCachedSparklines = [];
} }
sparklineGroup.prototype.clearCached = function() sparklineGroup.prototype.clearCached = function() {
{ this.arrCachedSparklines.length = 0;
this.arrCachedSparklines.length = 0;
}; };
sparklineGroup.prototype.addView = function(oSparklineView) sparklineGroup.prototype.addView = function(oSparklineView) {
{ this.arrCachedSparklines.push(oSparklineView);
this.arrCachedSparklines.push(oSparklineView);
}; };
sparklineGroup.prototype.draw = function(oDrawingContext) sparklineGroup.prototype.draw = function(oDrawingContext) {
{ var graphics = new CGraphics();
var graphics = new CGraphics(); graphics.init(oDrawingContext.ctx, oDrawingContext.getWidth(0), oDrawingContext.getHeight(0),
graphics.init(oDrawingContext.ctx, oDrawingContext.getWidth(0), oDrawingContext.getHeight(0), oDrawingContext.getWidth(3), oDrawingContext.getHeight(3)); oDrawingContext.getWidth(3), oDrawingContext.getHeight(3));
graphics.m_oFontManager = g_fontManager; graphics.m_oFontManager = g_fontManager;
for(var i = 0; i < this.arrCachedSparklines.length; ++i) for (var i = 0; i < this.arrCachedSparklines.length; ++i) {
{ this.arrCachedSparklines[i].draw(graphics);
this.arrCachedSparklines[i].draw(graphics); }
}
}; };
sparklineGroup.prototype.updateCache = function(wsView) sparklineGroup.prototype.updateCache = function(range) {
{ for (var i = 0; i < this.arrSparklines.length; ++i) {
wsView.objectRender.createSparklineViews(this); if (range.intersectionSimple(this.arrSparklines[i].f)) {
this.arrCachedSparklines[i] = null;
}
}
}; };
/** @constructor */ /** @constructor */
function sparkline() { function sparkline() {
......
...@@ -2027,7 +2027,10 @@ function DrawingObjects() { ...@@ -2027,7 +2027,10 @@ function DrawingObjects() {
_this.drawSparkLineGroups = function(oDrawingContext, oSparkLineGroups, range) _this.drawSparkLineGroups = function(oDrawingContext, oSparkLineGroups, range)
{ {
for(var i = 0; i < oSparkLineGroups.arrSparklineGroup.length; ++i) { 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