Skip to content

Commit 6ebe332

Browse files
committed
Detect blending more accurately
1 parent f574325 commit 6ebe332

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scatter.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ var proto = GLScatterFancy.prototype
126126

127127
var gl = plot.gl
128128
var shader = pick ? this.pickShader : this.shader
129+
var blend = gl.isEnabled(gl.BLEND)
129130

130131
shader.bind()
131132

@@ -144,7 +145,7 @@ var proto = GLScatterFancy.prototype
144145
} else {
145146
gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
146147
gl.blendColor(0,0,0,1);
147-
gl.enable(gl.BLEND)
148+
if (!blend) gl.enable(gl.BLEND)
148149

149150
this.colorBuffer.bind()
150151
shader.attributes.color.pointer(gl.UNSIGNED_BYTE, false)
@@ -200,7 +201,7 @@ var proto = GLScatterFancy.prototype
200201

201202
if (pick) return offset + pointCount
202203
else {
203-
gl.disable(gl.BLEND)
204+
if (!blend) gl.disable(gl.BLEND)
204205
}
205206
}
206207
})()

0 commit comments

Comments
 (0)