Skip to content

Commit

Permalink
skip calls to canvas.paintNow during createColumns()
Browse files Browse the repository at this point in the history
  • Loading branch information
joneit committed Jul 10, 2018
1 parent ba3f2db commit eb54c56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Hypergrid/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ var Hypergrid = Base.extend('Hypergrid', {
var canvas = this.canvas;
if (canvas) {
if (this.properties.repaintImmediately) {
canvas.paintNow();
this.paintNow();
} else {
canvas.repaint();
}
Expand All @@ -976,7 +976,9 @@ var Hypergrid = Base.extend('Hypergrid', {
* @desc Paint immediately in this microtask.
*/
paintNow: function() {
this.canvas.paintNow();
if (this.behavior.columnsCreated) {
this.canvas.paintNow();
}
},

/**
Expand Down
4 changes: 4 additions & 0 deletions src/behaviors/Behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ var Behavior = Base.extend('Behavior', {
tc = this.treeColumnIndex,
rc = this.rowColumnIndex;

this.columnsCreated = false;

schema[tc] = schema[tc] || {};
schema[tc].index = tc;
if (schema[tc].name === undefined) { schema[tc].name = this.treeColumnNameDefault; }
Expand Down Expand Up @@ -325,6 +327,8 @@ var Behavior = Base.extend('Behavior', {
realImplementation.call(this);
}

this.columnsCreated = true;

this.changed();

dispatchGridEvent.call(this.grid, 'fin-hypergrid-columns-created');
Expand Down

0 comments on commit eb54c56

Please sign in to comment.