Skip to content

Commit

Permalink
Gate clearing x-coords pool
Browse files Browse the repository at this point in the history
  • Loading branch information
dy committed Jun 6, 2017
1 parent 664c3b6 commit e61cf18
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion example/points.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var POINT_COUNT = 1e6

var positions = new Float32Array(2 * POINT_COUNT)
for(var i=0; i<2*POINT_COUNT; ++i) {
positions[i] = Math.random() * 10 - 5
positions[i] = random() * 10
}


Expand Down
4 changes: 2 additions & 2 deletions scatter2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ proto.update = function(options) {
this.borderColor = dflt('borderColor', [0, 0, 0, 1]).slice()
this.snapPoints = dflt('snapPoints', true)

if(this.xCoords) pool.free(this.xCoords)

//do not recalc points if there is no positions
if (options.positions != null) {
if(this.xCoords) pool.free(this.xCoords)

this.points = options.positions
var pointCount = this.points.length >>> 1

Expand Down

0 comments on commit e61cf18

Please sign in to comment.