Skip to content

Commit ff68474

Browse files
committed
don't draw if number of elements is 0
1 parent 4a68ffe commit ff68474

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

line.js

+8
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ return function() {
7070
var bounds = this.bounds
7171
var count = this.vertCount
7272

73+
if(!count) {
74+
return
75+
}
76+
7377
var gl = plot.gl
7478
var viewBox = plot.viewBox
7579
var dataBox = plot.dataBox
@@ -208,6 +212,10 @@ proto.drawPick = (function() {
208212

209213
this.pickOffset = pickOffset
210214

215+
if(!count) {
216+
return pickOffset + numPoints
217+
}
218+
211219
MATRIX[0] = 2.0 * boundX / dataX
212220
MATRIX[4] = 2.0 * boundY / dataY
213221
MATRIX[6] = 2.0 * (bounds[0] - dataBox[0]) / dataX - 1.0

0 commit comments

Comments
 (0)